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?
Answer 1, Authority 100%
declare @result nvarchar (MAX) Select @Result = Coalesce (@Result + ',', '') + Comment From dbo.reason. SELECT @RESULT.
changed a little, at the end there will be a comma:
declare @result nvarchar (max) = '' SELECT @RESULT = @RESULT + COMMENT + ',' From dbo.reason. SELECT @RESULT