<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: SQL SERVER &#8211; Comma Separated Values (CSV) from Table Column &#8211; Part 2</title>
	<atom:link href="http://blog.sqlauthority.com/2009/12/21/sql-server-comma-separated-values-csv-from-table-column-part-2/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.sqlauthority.com/2009/12/21/sql-server-comma-separated-values-csv-from-table-column-part-2/</link>
	<description>SQL, SQL Server, MySQL, Big Data and NoSQL</description>
	<lastBuildDate>Tue, 18 Jun 2013 16:46:54 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: SQL SERVER &#8211; Weekly Series &#8211; Memory Lane &#8211; #008 &#171; SQL Server Journey with SQL Authority</title>
		<link>http://blog.sqlauthority.com/2009/12/21/sql-server-comma-separated-values-csv-from-table-column-part-2/#comment-397388</link>
		<dc:creator><![CDATA[SQL SERVER &#8211; Weekly Series &#8211; Memory Lane &#8211; #008 &#171; SQL Server Journey with SQL Authority]]></dc:creator>
		<pubDate>Sat, 22 Dec 2012 01:31:56 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=7575#comment-397388</guid>
		<description><![CDATA[[...] Comma Separated Values (CSV) from Table Column It is a very common request to create List or CSV from Table Column. We are going to explore the same concept in this blog &#8211; I have tried to use XML to generate the solution of this issue.  Here is the blog post I wrote for the same subject earlier:  Comma Separated Values (CSV) from Table Column [...]]]></description>
		<content:encoded><![CDATA[<p>[...] Comma Separated Values (CSV) from Table Column It is a very common request to create List or CSV from Table Column. We are going to explore the same concept in this blog &#8211; I have tried to use XML to generate the solution of this issue.  Here is the blog post I wrote for the same subject earlier:  Comma Separated Values (CSV) from Table Column [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SQL SERVER &#8211; Grouping by Multiple Columns to Single Column as A String &#171; SQL Server Journey with SQL Authority</title>
		<link>http://blog.sqlauthority.com/2009/12/21/sql-server-comma-separated-values-csv-from-table-column-part-2/#comment-345087</link>
		<dc:creator><![CDATA[SQL SERVER &#8211; Grouping by Multiple Columns to Single Column as A String &#171; SQL Server Journey with SQL Authority]]></dc:creator>
		<pubDate>Fri, 14 Sep 2012 01:31:35 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=7575#comment-345087</guid>
		<description><![CDATA[[...] Comma Separated Values (CSV) from Table Column – Part 2 [...]]]></description>
		<content:encoded><![CDATA[<p>[...] Comma Separated Values (CSV) from Table Column – Part 2 [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SQL SERVER &#8211; Importing CSV File Into Database &#8211; SQL in Sixty Seconds #018 &#8211; Video &#171; SQL Server Journey with SQL Authority</title>
		<link>http://blog.sqlauthority.com/2009/12/21/sql-server-comma-separated-values-csv-from-table-column-part-2/#comment-303406</link>
		<dc:creator><![CDATA[SQL SERVER &#8211; Importing CSV File Into Database &#8211; SQL in Sixty Seconds #018 &#8211; Video &#171; SQL Server Journey with SQL Authority]]></dc:creator>
		<pubDate>Wed, 20 Jun 2012 01:32:03 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=7575#comment-303406</guid>
		<description><![CDATA[[...] SQL SERVER – Comma Separated Values (CSV) from Table Column – Part 2 [...]]]></description>
		<content:encoded><![CDATA[<p>[...] SQL SERVER – Comma Separated Values (CSV) from Table Column – Part 2 [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chintan Gandhi</title>
		<link>http://blog.sqlauthority.com/2009/12/21/sql-server-comma-separated-values-csv-from-table-column-part-2/#comment-246951</link>
		<dc:creator><![CDATA[Chintan Gandhi]]></dc:creator>
		<pubDate>Thu, 02 Feb 2012 09:23:05 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=7575#comment-246951</guid>
		<description><![CDATA[I agree, we cannot use this if the strings contain special characters like ampersand,less than , etc

Is there another solution apart from using COLAESECE?]]></description>
		<content:encoded><![CDATA[<p>I agree, we cannot use this if the strings contain special characters like ampersand,less than , etc</p>
<p>Is there another solution apart from using COLAESECE?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tejas Shah</title>
		<link>http://blog.sqlauthority.com/2009/12/21/sql-server-comma-separated-values-csv-from-table-column-part-2/#comment-61152</link>
		<dc:creator><![CDATA[Tejas Shah]]></dc:creator>
		<pubDate>Mon, 15 Feb 2010 09:36:57 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=7575#comment-61152</guid>
		<description><![CDATA[Hi Manish,

You can generate list of comma separated file as described here at: http://www.sqlyoga.com/2009/02/sql-server-get-comma-separated-list.html

Thanks,

Tejas
SQLYoga.com]]></description>
		<content:encoded><![CDATA[<p>Hi Manish,</p>
<p>You can generate list of comma separated file as described here at: <a href="http://www.sqlyoga.com/2009/02/sql-server-get-comma-separated-list.html" rel="nofollow">http://www.sqlyoga.com/2009/02/sql-server-get-comma-separated-list.html</a></p>
<p>Thanks,</p>
<p>Tejas<br />
SQLYoga.com</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ashish</title>
		<link>http://blog.sqlauthority.com/2009/12/21/sql-server-comma-separated-values-csv-from-table-column-part-2/#comment-61146</link>
		<dc:creator><![CDATA[Ashish]]></dc:creator>
		<pubDate>Mon, 15 Feb 2010 06:37:16 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=7575#comment-61146</guid>
		<description><![CDATA[@manish

you can use distinct before column name]]></description>
		<content:encoded><![CDATA[<p>@manish</p>
<p>you can use distinct before column name</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: manish</title>
		<link>http://blog.sqlauthority.com/2009/12/21/sql-server-comma-separated-values-csv-from-table-column-part-2/#comment-61122</link>
		<dc:creator><![CDATA[manish]]></dc:creator>
		<pubDate>Sun, 14 Feb 2010 04:58:04 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=7575#comment-61122</guid>
		<description><![CDATA[Is there a way to remove duplicates?

for e.g. Table has two columns

Col A   Col B
Test1    Val1
Test2     Val2
Test1   Val3

if i have select stuff on colA and stuff on colB the result is something like
Col A                         ColB
Test1,Test2,              Val1,Val2,Val3
Test1

how would i remove duplicate from ColA and display only Test1,Test2]]></description>
		<content:encoded><![CDATA[<p>Is there a way to remove duplicates?</p>
<p>for e.g. Table has two columns</p>
<p>Col A   Col B<br />
Test1    Val1<br />
Test2     Val2<br />
Test1   Val3</p>
<p>if i have select stuff on colA and stuff on colB the result is something like<br />
Col A                         ColB<br />
Test1,Test2,              Val1,Val2,Val3<br />
Test1</p>
<p>how would i remove duplicate from ColA and display only Test1,Test2</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Madhivanan</title>
		<link>http://blog.sqlauthority.com/2009/12/21/sql-server-comma-separated-values-csv-from-table-column-part-2/#comment-61058</link>
		<dc:creator><![CDATA[Madhivanan]]></dc:creator>
		<pubDate>Fri, 12 Feb 2010 09:33:15 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=7575#comment-61058</guid>
		<description><![CDATA[Yes. MySQL has a Group_concat function to do the same task
But usually this kind of thing should be done in front end application]]></description>
		<content:encoded><![CDATA[<p>Yes. MySQL has a Group_concat function to do the same task<br />
But usually this kind of thing should be done in front end application</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: nigwoko</title>
		<link>http://blog.sqlauthority.com/2009/12/21/sql-server-comma-separated-values-csv-from-table-column-part-2/#comment-59520</link>
		<dc:creator><![CDATA[nigwoko]]></dc:creator>
		<pubDate>Sat, 09 Jan 2010 13:55:30 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=7575#comment-59520</guid>
		<description><![CDATA[Dave, you&#039;re the man!]]></description>
		<content:encoded><![CDATA[<p>Dave, you&#8217;re the man!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: brejk</title>
		<link>http://blog.sqlauthority.com/2009/12/21/sql-server-comma-separated-values-csv-from-table-column-part-2/#comment-59275</link>
		<dc:creator><![CDATA[brejk]]></dc:creator>
		<pubDate>Sat, 02 Jan 2010 23:03:31 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=7575#comment-59275</guid>
		<description><![CDATA[Huh, special chars were removed from my previous comment :-)]]></description>
		<content:encoded><![CDATA[<p>Huh, special chars were removed from my previous comment :-)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: brejk</title>
		<link>http://blog.sqlauthority.com/2009/12/21/sql-server-comma-separated-values-csv-from-table-column-part-2/#comment-59274</link>
		<dc:creator><![CDATA[brejk]]></dc:creator>
		<pubDate>Sat, 02 Jan 2010 23:02:21 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=7575#comment-59274</guid>
		<description><![CDATA[Pinal, you still have to look out for some special characters when performing a concatenation with FOR XML PATH clause. For example, if you would like to concatenate three values: aaa, bbb and  you would get &lt; and &gt; instead of  chars. I would rather recommend writing your own CLR aggregate function for this kind of operation.]]></description>
		<content:encoded><![CDATA[<p>Pinal, you still have to look out for some special characters when performing a concatenation with FOR XML PATH clause. For example, if you would like to concatenate three values: aaa, bbb and  you would get &lt; and &gt; instead of  chars. I would rather recommend writing your own CLR aggregate function for this kind of operation.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Saurabh Wajpe</title>
		<link>http://blog.sqlauthority.com/2009/12/21/sql-server-comma-separated-values-csv-from-table-column-part-2/#comment-58862</link>
		<dc:creator><![CDATA[Saurabh Wajpe]]></dc:creator>
		<pubDate>Mon, 21 Dec 2009 07:05:28 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=7575#comment-58862</guid>
		<description><![CDATA[Hi Pinal,
Please check this way, and let me know is it okay or it has some issues?





GO


-- We can write a function for it

CREATE FUNCTION [dbo].[GetShifts] ()
RETURNS NVARCHAR(MAX)
WITH EXECUTE AS CALLER
AS
BEGIN
	   declare     @output varchar(max)
       set         @output = null;
       select @output = COALESCE(@output + &#039;, &#039;, &#039;&#039;) + convert(varchar(max),[Name]) 
       from [MyRnDDataBase].[dbo].[HumanResources.Shift]       
			
		RETURN @output

END


-- Check Table Column
SELECT [Name]
  FROM [MyRnDDataBase].[dbo].[HumanResources.Shift]


-- AND Now we&#039;ll just call that function
SELECT [dbo].GetShifts() AS CSV




It’ll give you the same result plus it provides code reusability as we just need to call the function wherever necessary. Isn’t it?]]></description>
		<content:encoded><![CDATA[<p>Hi Pinal,<br />
Please check this way, and let me know is it okay or it has some issues?</p>
<p>GO</p>
<p>&#8211; We can write a function for it</p>
<p>CREATE FUNCTION [dbo].[GetShifts] ()<br />
RETURNS NVARCHAR(MAX)<br />
WITH EXECUTE AS CALLER<br />
AS<br />
BEGIN<br />
	   declare     @output varchar(max)<br />
       set         @output = null;<br />
       select @output = COALESCE(@output + &#8216;, &#8216;, &#8221;) + convert(varchar(max),[Name])<br />
       from [MyRnDDataBase].[dbo].[HumanResources.Shift]       </p>
<p>		RETURN @output</p>
<p>END</p>
<p>&#8211; Check Table Column<br />
SELECT [Name]<br />
  FROM [MyRnDDataBase].[dbo].[HumanResources.Shift]</p>
<p>&#8211; AND Now we&#8217;ll just call that function<br />
SELECT [dbo].GetShifts() AS CSV</p>
<p>It’ll give you the same result plus it provides code reusability as we just need to call the function wherever necessary. Isn’t it?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ghill</title>
		<link>http://blog.sqlauthority.com/2009/12/21/sql-server-comma-separated-values-csv-from-table-column-part-2/#comment-58860</link>
		<dc:creator><![CDATA[ghill]]></dc:creator>
		<pubDate>Mon, 21 Dec 2009 05:17:07 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=7575#comment-58860</guid>
		<description><![CDATA[This function is an attempt to reproduce the functionality of the build-in group_concat from MySQL, why is it that this is still missing from SQL Server?]]></description>
		<content:encoded><![CDATA[<p>This function is an attempt to reproduce the functionality of the build-in group_concat from MySQL, why is it that this is still missing from SQL Server?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
