Can SQL Server 2008 use a variable in a WHERE IN clause

Are there any updates in SQL Server 2008 to allow a variable for INpredicate clause WHERE?

Will this code work properly?

declare @InParams varchar(100) = '1,2';

select * from Category
where CategoryID in @InParams;
+3
source share
2 answers
+7
source

No - you still need to use either:

  • split function, CLR function with tabular rating or table.
  • dynamic SQL
+5
source

Source: https://habr.com/ru/post/1746293/


All Articles