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 |
|
mdanwerali
Starting Member
30 Posts |
Posted - 2002-11-09 : 05:28:53
|
| hii have a problem using COALESCE function, where i am wrong... please suggest me, with this query i am not able to store the second or third record details in the variable.... even though this condition satisfies more than one record.---------------------DECLARE @topicdesc varchar(8000)SELECT @topicdesc = COALESCE(@topicdesc + ', ', '') + CAST(tpmdetails AS varchar(4000))FROM topicmasterWHERE tpmtopicid = 'TM00000038' or tpmowner = 'TM00000038'SELECT @topicdesc---------------here i am trying to fetch more than one record into @topicdesc but unfortunately i am not able to see the output of second record. Means it is fetching only the first records and from second it is omitting. where i am wrong.md anwer ali |
|
|
SamC
White Water Yakist
3467 Posts |
Posted - 2002-11-09 : 14:04:43
|
| I'd like to see the output ofSELECT CAST(tpmdetails AS varchar(4000)) FROM topicmaster WHERE tpmtopicid = 'TM00000038' or tpmowner = 'TM00000038' I assume it has more than 1 row, but seeing is believing.Sam |
 |
|
|
nr
SQLTeam MVY
12543 Posts |
Posted - 2002-11-10 : 17:37:11
|
| Also how long are the fields.Query analyser will default to displaying 256 chars - you can change this in advanced settings.==========================================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. |
 |
|
|
|
|
|