I would like to pass in the 'In' portion of a query to a stored procedure, but I'm having problems.
select * from table where phone IN ('555-5555', '666-6666');
that query correctly returns 2 results.
declare @where nvarchar(max);
set @where = '''555-5555'', ''666-6666'''
select * from table where phone IN (@where);
I suspect I have an error with my escape strings for the single quotes, but I've tried several combinations such as using double quotes with singles inside, etc, but to no avail.
I'm sure there's a simple solution.