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 2008 Forums
 Transact-SQL (2008)
 Splitting data

Author  Topic 

sg2255551
Constraint Violating Yak Guru

274 Posts

Posted - 2011-02-06 : 11:19:11
hi

I have a field name productrating and its data is this

ProdA Good/Bad/Worst
ProdB
ProdC
ProdD Good/Bad
ProdE
ProdF Satisfactory/Unsatisfactory

How do I split them into row for example
ProdA Good
ProdA Bad
ProdA Worst
prodA
ProdB
ProdC
ProdD Good
ProdD Bad
ProdD
ProdE
ProdF Satisfactory
ProdF Unsatisfactory
ProdF

Thanks a lot

robvolk
Most Valuable Yak

15732 Posts

Posted - 2011-02-06 : 11:47:54
You can easily modify this technique: http://www.sqlteam.com/article/parsing-csv-values-into-multiple-rows
Go to Top of Page
   

- Advertisement -