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.
| Author |
Topic |
|
shiyam198
Yak Posting Veteran
94 Posts |
Posted - 2011-05-27 : 16:27:51
|
| I tried this problem my self and I could not pass the first data.So, I have column with data such as text01,test02,test02,test03. the highest number of data on the column is 13 data. I have created 13 more columns on the table to insert that data.I am able to spilit the first data using subscrting and charindex and insert the first data to the first column. I am unable to do the consequent data. I have been grinding my teeth on this for past 2 hours. If someone has a way to acheive this, can you please let me knowMany thanks,Shiyam |
|
|
sunitabeck
Master Smack Fu Yak Hacker
5155 Posts |
Posted - 2011-05-27 : 17:56:56
|
| You need a way to split the comma-separated string into individual tokens. There are a number of methods to do this, one that I like is the code in Fig. 21 of Jeff Moden's article here: http://www.sqlservercentral.com/articles/Tally+Table/72993/ Copy the code and run it to install the function, and then use that to split the string into tokens and insert into where you need it to be. |
 |
|
|
jfarrugia
Yak Posting Veteran
55 Posts |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
|
|
shiyam198
Yak Posting Veteran
94 Posts |
Posted - 2011-05-30 : 14:35:13
|
| Thanks a lot all. |
 |
|
|
Jeff Moden
Aged Yak Warrior
652 Posts |
|
|
|
|
|