Hi all,
Had a sql question for you SQL folks out there... using sqlserver:
DECLARE @MyVar varchar
SET @MyVar = "('one', 'two')"
I'm able to do this:
SELECT * FROM Table WHERE field = @MyVar
...but not this:
SELECT * FROM Table WHERE field IN @MyVar
Is there a way to do the 2nd SELECT without building up a string and running it via EXEC(), or is that the way it has to be done?
Thanks!
Had a sql question for you SQL folks out there... using sqlserver:
DECLARE @MyVar varchar
SET @MyVar = "('one', 'two')"
I'm able to do this:
SELECT * FROM Table WHERE field = @MyVar
...but not this:
SELECT * FROM Table WHERE field IN @MyVar
Is there a way to do the 2nd SELECT without building up a string and running it via EXEC(), or is that the way it has to be done?
Thanks!