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
 SQL Server Development (2000)
 making a string from some rows

Author  Topic 

pelegk2
Aged Yak Warrior

723 Posts

Posted - 2006-06-26 : 02:45:19
i have few rows in a table like this :
id,val
1,698
2,945
3,2368

i want to take all the values and convert them into 1 string in this structure : 698,945,2368

iwhat the fastet easiet way withoughtthe need to use cursors?
thnaksi n advance
peleg

Israel -the best place to live in aftr heaven 9but no one wan't to go there so fast -:)

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2006-06-26 : 02:50:52
refer to here http://sqljunkies.com/WebLog/amachanic/archive/2004/11/10/5065.aspx


KH

Go to Top of Page

pelegk2
Aged Yak Warrior

723 Posts

Posted - 2006-06-26 : 03:14:58
nice solution
thnaks:)

Israel -the best place to live in aftr heaven 9but no one wan't to go there so fast -:)
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-06-26 : 04:14:33
Note that you may have problem if the concatenated string exceeds 8000 characters. If you use front end application, do concatenation there

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

pelegk2
Aged Yak Warrior

723 Posts

Posted - 2006-06-26 : 04:39:43
yes i thoght of that already and taken care of it
thnaks for the tip any way

Israel -the best place to live in aftr heaven 9but no one wan't to go there so fast -:)
Go to Top of Page
   

- Advertisement -