Geeks With Blogs
Rohit Gupta Engaging talk on Microsoft Technologies ....My Resume
December 2009 Entries
Split SQL 2005 column values into multiple rows
Suppose that you have a column that stored multiple values in a single row using some delimiter as ‘,’. Now you are tasked with splitting these values into a separate row for each value and you need to do this on multiple rows in the table. 1: select distinct r.items 2: from Order o 3: cross apply dbo.split(o.Products,',') r SHere the Order Table has a Products column that has multiple Products stored in a single column separated with commas like ‘Tea,Coffee’ associated with a single Order. What ......

Posted On Monday, December 14, 2009 9:56 AM

Copyright © Rohit Gupta | Powered by: