Click here to Skip to main content
12,348,946 members (55,779 online)
Click here to Skip to main content
Add your own
alternative version

Tagged as

Stats

9K views
9 bookmarked
Posted

Get Column values as comma seperated string

, 19 Jan 2010 CPOL
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.

You may also be interested in...

Comments and Discussions

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