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

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 String Split Question
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

tonydang2002
Starting Member

15 Posts

Posted - 03/06/2014 :  16:57:22  Show Profile  Reply with Quote
Hi,
I have data string as below:
1001|Tony|92841|,|1002|Dennis|92683|,1003|David|92541

I'm looking for SQL script or SP that I can run to split into multiple rows and insert this into a SQL table.

something like:
EXEC stringsplit '1001|Tony|92841|,|1002|Dennis|92683|,1003|David|92541'

and my end result would be:
My table:
ID Name Zipcode
1001 Tony 92841
1002 Dennis 92683
1003 David 92541

Thank you for your help!
Tony

khtan
In (Som, Ni, Yak)

Singapore
17689 Posts

Posted - 03/06/2014 :  17:11:59  Show Profile  Reply with Quote
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=76033


KH
Time is always against us

Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000