My variable looks like this:
DECLARE @number AS NVARCHAR(1000)
SET @number = '1,2,3,4,5,6'
What I have in my WHERE statement is this:
WHERE V.client IN (@number)
My V.Client
column is an integer. What I am trying to do is remove the '' from the @number and make it look like 1,2,3,4,5,6. I have tried to do this,
',' + @number + ',' LIKE '%,' + CAST(V.client AS VARCHAR) + ',%'
but it only returns results for 1 and not the other numbers.
Does anyone have any ideas as to what I can do?