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)
 How do i split a variable seperated by commas

Author  Topic 

afrika
Master Smack Fu Yak Hacker

2706 Posts

Posted - 2005-03-20 : 13:18:13
hello,
how do i split a variable seperated by a comma.

And then insert each variable into a table, along with other static variables, from a SP ?

e.g.

phone_number = 254325,254235,3254235432,4325432543
message = hello Afrika

results

Phone number message
254234523453 hello Afrika
234523452345 hello Afrika
254524524352 hello Afrika

...etc


Thanks
Afrika

Kristen
Test

22859 Posts

Posted - 2005-03-20 : 13:19:08
Plenty of examples of how to do that on SQL Team. Try searching on the terms "split" and "CSV"

Kristen
Go to Top of Page

afrika
Master Smack Fu Yak Hacker

2706 Posts

Posted - 2005-03-20 : 13:47:39
Ok, I got a very useful article by Robvolk

http://www.sqlteam.com/item.asp?ItemID=2652
Go to Top of Page
   

- Advertisement -