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
 separate a long string and put them into three col

Author  Topic 

johnmason137
Starting Member

1 Post

Posted - 2015-04-17 : 23:38:56
Can someone tell me how to separate a long string and put them into three columns.

For example string

Toronto|Ontario|Canada,Dallas|Texas|USA,New York|New York|USA,Windsor|Ontario|Canada




I have a table with 5 columns, 3 columns are City, State and Country.




I would like to separate them and put those into categories




Continent City State Country Added

Toronto Ontario Canada

Dallas Texas USA

New York New York USA

gbritton
Master Smack Fu Yak Hacker

2780 Posts

Posted - 2015-04-18 : 09:57:27
http://www.sqlservercentral.com/articles/Tally+Table/72993/
Go to Top of Page
   

- Advertisement -