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)
 any suggestions?

Author  Topic 

harshal_in
Aged Yak Warrior

633 Posts

Posted - 2002-10-30 : 04:11:13
hi,
I want the result of a query in a query seperated string .
For e.g.

select * from a

gives me:
1
2
3

but can I get
the output as

1,2,3



is this thing possible?
thnxs.
harsh


nr
SQLTeam MVY

12543 Posts

Posted - 2002-10-30 : 04:28:59
search the site for csv.

declare @s varchar(2000)
select @s = coalesce(@s + ',','') + fld
from a
select @s

==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

harshal_in
Aged Yak Warrior

633 Posts

Posted - 2002-10-30 : 05:02:19
it was just what I needed .
thnxs a lot nr.
harsh.

Go to Top of Page
   

- Advertisement -