So, In my stored procedure I have
Update Table
Set Table.Value = 2
Where Table.ID In (1,2,3)
I call the stored procedure and I want to pass in the 1,2,3. There is an unknown number of values in this list so I can't just use several variables.
I have tried the following but this doesn't work
Declare @IDS Varchar = '1,2,3';
Update Table
Set Table.Value = 2
Where Table.ID In (@IDS)
Is there an array type (or similar) in T-SQL that would allow me to pass multiple values in for this purpose?
Thanks