How to write stored procedure to do this?
- by chobo
I would like to create a stored procedure that takes in a string of comma separated values like this "1,2,3,4", and break it apart and use those numbers to run a query on a different table.
so in the same stored procedure it would do something like
select somefield from sometable where somefield = 1
select somefield from sometable where somefield = 2
select somefield from sometable where somefield = 3
select somefield from sometable where somefield = 4
Thanks!