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)
 Split comma seprated values into rows

Author  Topic 

ahmadjamalkhan
Starting Member

36 Posts

Posted - 2010-04-08 : 12:17:37
Hi

I have following tableA with two columns ,

CountryName ,CountryCode
USA 1601,1602,1603,1604
Canada 1901,1904,1903

I am trying to split Countrycode into rows , such that my desired result looks like this

CountryName , CountryCode
USA 1601
USA 1602
USA 1603
USA 1604
Canada 1901
Canada 1904
Canada 1903

Thanks
Canada

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-04-08 : 12:28:37
see

http://www.sqlservercentral.com/articles/T-SQL/62867/

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2010-04-08 : 12:34:58
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=50648&whichpage=3#341426
Go to Top of Page

ahmadjamalkhan
Starting Member

36 Posts

Posted - 2010-04-09 : 12:21:07
Manay thanks.
Go to Top of Page
   

- Advertisement -