TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
C# Corner
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Get a column value in a single coma separated string in SQL
Kunal Vaishya
Jul 09, 2012
6.6
k
0
2
facebook
twitter
linkedIn
Reddit
WhatsApp
Email
Bookmark
We can get all value as single string with coma separator using this query.
We 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 ItMast
Select @id
After you will get result like this
Single string with couma seprater in Sql
Next Recommended Reading
Convert Multiple Rows into One Comma Separated Values in SQL server 2008