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
 General SQL Server Forums
 New to SQL Server Programming
 SQL String Split Question

Author  Topic 

tonydang2002
Starting Member

15 Posts

Posted - 2014-03-06 : 16:54:22
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

   

- Advertisement -