I am passing in a dynamic number of id's in csv format as a sql parameter and want to use them in a where clause for a select statement.
I can't get my head around how to do this in sql.
Pseudocode would look something like this:
@ids varchar(max)
select stuff from table
where stuff = [email protected](',')
Any help would be greatly appreciated.
ok after a bit of research i think that the best way to do this is with xml rather than csv's since it will be less effort so I am going to select the best answer and close this. Thanks guys.
JOINs?) - you either have to list a specific number of parameters, or construct the query dynamically (more difficult, and a little dangerous).