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 |
|
mary_itohan
Posting Yak Master
191 Posts |
Posted - 2008-09-13 : 00:37:54
|
Hello Guys,I have a table with values as thusColumn name: recipients Values are thusrecipients 252542542545674747645699401430227292330039560358992009932542I have a stored procedure and want to get this back.quote: declare @s varchar(8000)SELECT @s = recipient FROM historyprint @s
I want print statement to give me this values backprint @s = '2525425425,4567474764,5699401430,2272923300,3956035899,2009932542'Any ideas ? thanks a lot_____________________Yes O ! |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2008-09-13 : 01:41:28
|
[code]select @s = isnull(@s + ',', '') + receipientfrom history[/code] KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
raky
Aged Yak Warrior
767 Posts |
Posted - 2008-09-13 : 03:18:02
|
quote: Originally posted by khtan
select @s = isnull(@s + ',') + receipientsfrom history KH[spoiler]Time is always against us[/spoiler]
I think you had forgotten to give another argument for Isnull Functionselect @s = isnull(@s + ',','') + recipientsfrom history |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2008-09-13 : 03:19:31
|
Oops  KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
|
|
|
|
|