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 |
|
khalik
Constraint Violating Yak Guru
443 Posts |
Posted - 2003-01-07 : 01:21:11
|
| select folder_id from oit_foldersresult 135667745567765i need the value to be in this form1,3,5,66,77,45,567,765 is this possible i read some where but lost it======================================Ask to your self before u ask someone |
|
|
nr
SQLTeam MVY
12543 Posts |
Posted - 2003-01-07 : 03:08:45
|
| declare @s varchar(1000)select @s = coalesce(@s + ',', '') + convert(varchar(20),folder_id)from oit_folders==========================================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. |
 |
|
|
khalik
Constraint Violating Yak Guru
443 Posts |
Posted - 2003-01-08 : 07:22:23
|
| thanks a lot nr... that was cool can we avoid the varible... if that is eliminate i need to pass the query as sub query suing in operatedi can run a single query and get the result out======================================Ask to your self before u ask someone |
 |
|
|
nr
SQLTeam MVY
12543 Posts |
Posted - 2003-01-08 : 07:29:02
|
| You could make it into a udf.create function tt()returns varchar(1000)asbegindeclare @s varchar(1000)declare @s varchar(1000) select @s = coalesce(@s + ',', '') + convert(varchar(20),folder_id) from oit_folders return @sendgoselect dbo.tt()==========================================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.Edited by - nr on 01/08/2003 07:35:39 |
 |
|
|
|
|
|
|
|