How do i select a few rows in SQL using the WHERE IN and the set of numbers is an input variable
I want to do the following
select datacolumn from datatable
where primarykey in (1, 2, 3)
I tried the following procedure but it doesn't work
declare @ids NVARCHAR(MAX)
select datacolumn from datatable
where primarykey in (@ids)
I use Sql Server 2008