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)
 Split string

Author  Topic 

chriztoph
Posting Yak Master

184 Posts

Posted - 2012-01-23 : 21:56:15
Hi Everyone,

I need to split a string and the output must be rows..

I don't know how to start my query so I end up here asking for a help.

Here is may sample data:

| ProductID
-----|----------------------------------
1 | P0001, P0002, P0003, P0004, P0005


The output should be like this:

| ProductID
----|----------
1 | P0001
2 | P0002
3 | P0003
4 | P0004
5 | P0005


Thanks in advance..

chriztoph
Posting Yak Master

184 Posts

Posted - 2012-01-23 : 22:23:57
Found an answer here:
http://stackoverflow.com/questions/6392340/sql-server-2008-split-multi-value-column-into-rows-with-unique-values

in case you have the same problem.
Go to Top of Page
   

- Advertisement -