MSSQL Tips & Tricks
Thursday, February 21, 2013
Concatenate all records into one line text
Below is the code that you can use for concatenating all records into one line text:
declare @s nvarchar(max)
select
@s = coalesce(@s + ',' + prod_code, prod_code)
from prod
select @s
1 comment:
Unknown
May 10, 2013 at 12:17 PM
nice
Reply
Delete
Replies
Reply
Add comment
Load more...
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
nice
ReplyDelete