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 |
sawantaartid
Starting Member
1 Post |
Posted - 2006-01-16 : 05:15:52
|
I need to build a comma separated string of the multiple rows returned out of query result. Select is only on one column. Below is the query I wrote for the same
Declare @Description varchar(100) set @Description = '' select @Description = @Description + [Description] FROM ud_LookupMGR_Data where dataid in (81,82,83,84) select @Description
This result returns only the value of 1st row.
Pls help
Thanks |
|
shallu1_gupta
Constraint Violating Yak Guru
394 Posts |
Posted - 2006-01-16 : 05:24:35
|
try this
Declare @Description varchar(4000) select @Description = coalesce(@Description + ',' , Description ) + Description FROM ud_LookupMGR_Data where dataid in (81,82,83,84) |
 |
|
madhivanan
Premature Yak Congratulator
22864 Posts |
|
muralin
Starting Member
1 Post |
Posted - 2008-11-18 : 08:25:15
|
Declare @Description varchar(4000) select @Description = coalesce(@Description + ',' , '') + Description FROM ud_LookupMGR_Data where dataid in (81,82,83,84)
it is working |
 |
|
|
|
|