Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Pass delimited values to stored proc

Author  Topic 

dmoonme
Starting Member

13 Posts

Posted - 2007-03-01 : 18:38:10
What I'm trying to accomplish is this... A user will select checkboxes which language they read,write, and speak. I want to be able to pass this delimited string/array to a stored proc that will parse the string/array and insert to a table.

Here's an example of data that will be sent to stored proc.

UserA_Id,Spanish,Fluent,Limited,Limited
UserA_Id,English,Fluent,Fluent,Fluent
UserA_Id,Chinese,Limited,Limited,Limited

I need help on how to create the stored proc that will do this.


khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2007-03-01 : 18:52:23
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=55210&SearchTerms=CSV,Splitting%20delimited%20lists,Best%20split%20functions


KH

Go to Top of Page

dmoonme
Starting Member

13 Posts

Posted - 2007-03-07 : 20:13:43
actually i'm going to be passing in something like:

UserA_Id,Spanish,Fluent,Limited,Limited;UserA_Id,English,Fluent,Fluent,Fluent;UserA_Id,Chinese,Limited,Limited,Limited

So I need a way to parse 2 delimiters, the comma which is the column separator and the semicolon which is the row separator.
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2007-03-07 : 20:18:16
if you have fixed number of words per ';' delimited, you can make use of http://www.mindsdoor.net/SQLTsql/f_GetEntryDelimiitted.html


KH

Go to Top of Page
   

- Advertisement -