The issue I am having is that I would like to declare a varchar to hold a couple comma separated values to use in an in operator.
DECLARE @TEST varchar(1000); SET @TEST=' ''test1'', ''test2'' ';
to confirm the value is set correctly I run a select on the variable
The result is 'test1','test2' which is what I am looking to place in my where clause:
Select * from testTable where col in (@TEST);
the result should return rows but nothing is returned. I also tried to use where col =any(@TEST) and it errors.
If any one can see the error in my ways I would be grateful. Thank you.