Get a column value in a single coma separated string in SQLKunal Vaishya14yPublished Jul 6, 2012, 12:00 AMUpdated Jul 9, 2012, 8:29 AM6.9k02Reactions×25BlogWe can get all values of a column in a single coma separated string this query. Declare @id varchar(Max)Select @id = coalesce(@id + ',' ,'') + Cast(ItCode as varchar(10)) From ItMastSelect @id After you will get result like thisCommentsJoin the conversation! Your thoughts help the community grow.Sign in to leave a commentIt is the same account you read, post and publish with — and you will come straight back to this page.Sign inCreate an account
Join the conversation! Your thoughts help the community grow.