pinaldave
Name: pinaldave
Score: 1,935.01
Last Seen: 292 days, 14 hours, 58 minutes ago
Member Since: 27 July, 2009
SqlServerKudos
atom rss
1
kudos
spam Kudos Remove

SQL SERVER – Comma Separated Values (CSV) from Table Column « Journey to SQL Authority with Pinal Dave

published 900 days, 12 hours, 59 minutes ago posted by pinaldavepinaldave 909 days, 15 hours, 29 minutes ago
Friday, December 04, 2009 7:45:26 PM GMT Wednesday, November 25, 2009 5:15:04 PM GMT
I use following script very often and I realized that I have never shared this script on this blog before. Creating Comma Separated Values (CSV) from Table Column is a very common task, and we all do this many times a day. Let us see the example that I use frequently and its output. USE AdventureWorks GO -- Check Table Column SELECT Name FROM HumanResources.Shift GO -- Get CSV values SELECT SUBSTRING( (SELECT ',' + s.Name FROM HumanResources.Shift s ORDER BY s.Name FOR XML PATH('')),2,2000... (more)
category: Query | clicked: 1 | 1 comment | | source: blog.sqlauthority.com
tags: pinaldave, SQL, SQLAuthority, SQLServer