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 2012 Forums
 Transact-SQL (2012)
 SEPARATE WORDS TO ROWS (Convert Comma Separated)

Author  Topic 

cogy_z
Starting Member

1 Post

Posted - 2015-05-03 : 18:09:05
I have a table Sample with data stored like below

ID | STRING |
------------------------------------------------------------------
1 | 'ENGLAN SPAIN' ITALY 'FRANCE GERMANY' BRAZIL


I need the output like..

-----------------
|ENGLAND SPAIN |
|---------------|
|ITALY |
|---------------|
|FRANCE GERMANY |
|---------------|
|BRAZIL |
-----------------


How can I do the same with a select query in SQL Server?

viggneshwar
Yak Posting Veteran

86 Posts

Posted - 2015-05-04 : 06:13:14
It can be done through loop or using XML

Regards
Viggneshwar A
Go to Top of Page
   

- Advertisement -