Insert statement whith unknown number of values extracted from a string

nooby

New Member
I have a stored procedure in a sql server 2008 db.
This stored procedure takes a parameter that is a list of max 5 comma separated integer values. This string is passed through a php sript and formatted like this:\[code\]01,02,03,14,15\[/code\]These values should go in this table:\[code\]Id | Type id-------------1 | 11 | 21 | 31 | 141 | 15\[/code\]...where id is the same and type id is one of the comma separated values.Obviously, I could have a string like "01,02,03" with only 3 values. So I need a way to insert only 3 rows in the above table resulting in:\[code\]Id | Type id-------------1 | 11 | 21 | 3\[/code\]I could modify either the php script or the stored procedure, so I'm open to all kinds of suggestion.
 
Back
Top