Click here to Skip to main content
Click here to Skip to main content

Tagged as

Go to top

Get Column values as comma seperated string

, 19 Jan 2010
Rate this:
Please Sign up or sign in to vote.
Ever wondered that how to get a comma (pipe or whatever) seperated result for a column in a table.The following statement show a simple example you can take as a starting point.Select (Stuff((Select ', ' + FName From Accounts FOR XML PATH('')),1,2,''))
Ever wondered that how to get a comma (pipe or whatever) seperated result for a column in a table.
 
The following statement show a simple example you can take as a starting point.
 
Select (Stuff((Select ', ' + FName From Accounts FOR XML PATH('')),1,2,''))

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Manas Bhardwaj
Architect
Netherlands Netherlands
Read my personal blog at www.manasbhardwaj.net.
Follow on   Twitter

Comments and Discussions

 
-- There are no messages in this forum --
| Advertise | Privacy | Mobile
Web04 | 2.8.140916.1 | Last Updated 19 Jan 2010
Article Copyright 2010 by Manas Bhardwaj
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid