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

Tagged as

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.
Follow on   Twitter   LinkedIn

Comments and Discussions

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