I have a string of IDs passed in from an external process as '1,4,8,2,3' to a stored procedure and I need to use these IDs in the SQL. Is there anyway to use these IDs in the stored procedure without using dynamic sql? Could a UDTF be built to accept these IDs as a parm and then return a table of the IDs?
NickLawrence 060000949J69 Posts
Re: Convert string of IDs to a result set or insert into a table2013-07-15T15:42:03ZThis is the accepted answer. This is the accepted answer.
There's an article on UDTFs that was recently posted to developerWorks.
Using a table function to break apart the CSV list into individual SQL values that are returned as rows and columns seems reasonable to me.