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 |
|
lkozhush
Starting Member
6 Posts |
Posted - 2003-10-02 : 01:51:38
|
| Hi there,have a quick question. trying to output table rows as a single stringloginame--------dmeadows kmavrona lkozhush mxd should be dmeadows, kmavrona, lkozhush, mxd.Thank you in advance.Lkozhush. |
|
|
Stoad
Freaky Yak Linguist
1983 Posts |
Posted - 2003-10-02 : 03:01:17
|
| [code]declare @s varchar(8000)set @s = ''select @s = @s + loginame + ', ' from tselect left(@s, len(@s) - 1)[/code] |
 |
|
|
mohdowais
Sheikh of Yak Knowledge
1456 Posts |
Posted - 2003-10-02 : 14:52:05
|
Or:DECLARE @str varchar(8000)SELECT @str = ISNULL(@str + ',', '') + loginame FROM tableNameOwais Make it idiot proof and someone will make a better idiot |
 |
|
|
lkozhush
Starting Member
6 Posts |
Posted - 2003-10-02 : 19:39:28
|
quote: Originally posted by Stoad
declare @s varchar(8000)set @s = ''select @s = @s + loginame + ', ' from tselect left(@s, len(@s) - 1)
Thank you for your assistance. Cheers. lkozhush |
 |
|
|
lkozhush
Starting Member
6 Posts |
Posted - 2003-10-02 : 19:40:04
|
quote: Originally posted by mohdowais Or:DECLARE @str varchar(8000)SELECT @str = ISNULL(@str + ',', '') + loginame FROM tableNameOwais Make it idiot proof and someone will make a better idiot
Thank you for your assistance. Cheers. lkozhush |
 |
|
|
|
|
|