There is select -creen, which returns 5 lines. How can you glue them into one with any separator?
Now I have it so: Select Comment + ',' from dbo.reason for xml path ('')
Maybe there is a better idea?
Thank you.
Answer 1, Authority 100%
declare @result nvarchar (MAX)
Select @Result = Coalesce (@Result + ',', '') + Comment
From dbo.reason.
SELECT @RESULT.
Answer 2
changed a little, at the end there will be a comma:
declare @result nvarchar (max) = ''
SELECT @RESULT = @RESULT + COMMENT + ','
From dbo.reason.
SELECT @RESULT