Are there any updates in SQL 2008 to allow a variable for the IN of a where clause?
Declare @InParams varchar(100)
Set @InParams = '1,2'
Select * from Category
Where CategoryID in @InParams
Are there any updates in SQL 2008 to allow a variable for the IN of a where clause?
Declare @InParams varchar(100)
Set @InParams = '1,2'
Select * from Category
Where CategoryID in @InParams
No - still need to use either:
See here: Arrays and Lists in SQL Server (pick your version), or here http://www.sommarskog.se/dynamic_sql.html