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 |
|
ranganath
Posting Yak Master
209 Posts |
Posted - 2007-11-02 : 02:27:18
|
| hi i have a problem that to insert into Tablei will send '1,2,3# 4,5,6# 7,8,9'My Output like thiscol1 col2 col31 2 34 5 67 8 9how to split and to insert into Table |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2007-11-02 : 02:33:14
|
[code]DECLARE @STR varchar(100)SELECT @STR = '1,2,3# 4,5,6# 7,8,9'SELECT dbo.fnParseString(-1, ',', data) AS col1, dbo.fnParseString(-2, ',', data) AS col2, dbo.fnParseString(-3, ',', data) AS col3FROM( SELECT LTRIM(Data) AS data FROM fnParseList('#', @STR)) d-- get the UDF FROM http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=76033[/code] KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
|
|
|
|
|