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)
 using an array in a stored procedure

Author  Topic 

rachel
Starting Member

1 Post

Posted - 2002-04-10 : 11:54:02
I am passing some values from an ASP page to a stored procedure, one of the parameters is a pipe delimited string like so:

question one| question two| question three

(there could be any number of these but I can pass the number of items in this string/array from the asp page also.

The first action is to do an insert into one table and retrieve the identity - no problems there but after I have done that I want to insert the identity and each value from the string/array into a different table so if 43 was the retrieved identity I would get

43 question one
43 question two
43 question three

It seems as if I need to do something like the split function in VBScript, split everything on pipe, start a counter and compare the counter with the parameter that lists how many values there are to do a while loop, but I have no idea how to get the values out from between the pipes!

TIA

Rachel

AndrewMurphy
Master Smack Fu Yak Hacker

2916 Posts

Posted - 2002-04-10 : 12:02:21
have a look at CSV in the FAQ/ Search of this site....solutions to this style of problem have been mentioned there.


just equate | to , when reading the problems/solutions.

Go to Top of Page

digory
Starting Member

13 Posts

Posted - 2002-04-10 : 14:19:10

You might like to take a peek at a function that I posted here a little while ago:

[url]http://www.sqlteam.com/Forums/topic.asp?TOPIC_ID=14185[/url]


Go to Top of Page
   

- Advertisement -