Concatenation of data in different rows can be done without using a cursor..
try this out...
DECLARE @desc VARCHAR(1000)
SELECT @desc =@desc + ', ' +
t_ReviewSection.PeerRevSectionDescription
FROM
t_ReviewSection
WHERE
t_ReviewSection.PeerRevID = @lngRevID
ORDER BY
t_ReviewSection.PeerRevSectionOrder
SET @Desc=substring(@Desc,3,len(@Desc))
Erland Sommarskog <so****@algonet.se> wrote in message news:<Xn**********************@127.0.0.1>...
Jerry (je************@ptd.net) writes: Thanks - I did it in code as you suggested. I always have that to fall
back on but you know how it is. You try to do everyting in the Sproc
if you can and I'm not nearly as talented in Sprocs as I am in VB.
Figured maybe I was missing something.
What to do in application code and what to do in SQL may not always
be obvious. But as a general rule of thumb, SQL is good for raw data
retrieval, and also business logic and also computations to some degree.
However, string handling and formatting is poor in SQL.