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
 General SQL Server Forums
 New to SQL Server Programming
 How to seperate 1 field into many

Author  Topic 

jatrix32
Starting Member

49 Posts

Posted - 2010-09-17 : 15:19:41
I have a record in a table1 that contains comma separated values,

34,5,28

I am inserting this information into another table2, but want a new record created for each value separated by a comma.

newrecord1 34
newrecord2 5
newrecord3 28


How can this be accomplished with sql?

jimf
Master Smack Fu Yak Hacker

2875 Posts

Posted - 2010-09-17 : 15:23:03

http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=113563

Jim



Everyday I learn something that somebody else already knew
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-09-18 : 09:15:18
see scenario 4

http://visakhm.blogspot.com/2010/01/multipurpose-apply-operator.html

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

Go to Top of Page
   

- Advertisement -