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
 SQL Server Development (2000)
 Splitting a string in stored procedure

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2002-05-23 : 10:38:44
girish writes "I want to update Master table and detail table through stored procedures. I am sending the details that has to updated in string fromat delimited by some special characters. How can i split it in the stored procedure and update master & detail table. Can any body help me. I require this urgent.

regards"

nr
SQLTeam MVY

12543 Posts

Posted - 2002-05-23 : 10:50:30
Have you searched the site - I'm sure there are articles on this.

Use charindex to find the delimitter and create a loop using while to go through the string to find the constituent parts.

==========================================
Cursors are useful if you don't know sql.
Beer is not cold and it isn't fizzy.
Go to Top of Page

robvolk
Most Valuable Yak

15732 Posts

Posted - 2002-05-23 : 11:49:44
A search for CSV will do it:

http://www.sqlteam.com/SearchResults.asp?SearchTerms=csv

You can modify any of these to work with whatever delimiter you wish.

Go to Top of Page
   

- Advertisement -