I want to use comma delimited string as an input for stored procedure. how to delimit the string and access the values? can anybody help ....
Accessing values of comma delimited string
Collapse
X
-
Tags: None
-
Originally posted by vishakha209I want to use comma delimited string as an input for stored procedure. how to delimit the string and access the values? can anybody help ....
Depends on how you will use the string. If it will be used as an IN set list (WHERE column in @yourvar), you can just replace your delimiter with a new one (quote-comma-quote, then add a quote in both side of the string). If you need each individual value, you have to parse it
That would be a combination of LEN, RTRIM, LTRIM, SUBSTRING. Here's the list of String Functions available in SQL Server.
Good luck.
-- CK
Comment