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 2000 Forums
 Transact-SQL (2000)
 How to split the string????????

Author  Topic 

thiyait
Yak Posting Veteran

70 Posts

Posted - 2005-08-31 : 23:59:15
HI ALL:

declare @strlist varchar(4000)

set @strlist=',11:101,22:2345,67:44,...'

I need to insert the above string in the following way..

Table:
-----
Firstvalue secondvalues
11 101
22 2345
67 44

Any one help me to solve the issue.

Thanks in advance

Thiya

Kristen
Test

22859 Posts

Posted - 2005-09-01 : 00:49:17
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=50648

has details of how to "split" a delimited string. You could split to rows based on "," and then to columns based on ":" (prob. using charindex for the second one)

Kristen
Go to Top of Page
   

- Advertisement -