<?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</title>
	<atom:link href="http://blog.sqlauthority.com/2009/11/25/sql-server-comma-separated-values-csv-from-table-column/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.sqlauthority.com/2009/11/25/sql-server-comma-separated-values-csv-from-table-column/</link>
	<description>SQL, SQL Server, MySQL, Big Data and NoSQL</description>
	<lastBuildDate>Thu, 20 Jun 2013 06:45:19 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: mahalakshmi</title>
		<link>http://blog.sqlauthority.com/2009/11/25/sql-server-comma-separated-values-csv-from-table-column/#comment-471849</link>
		<dc:creator><![CDATA[mahalakshmi]]></dc:creator>
		<pubDate>Thu, 09 May 2013 07:36:32 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=7133#comment-471849</guid>
		<description><![CDATA[SELECT PARSENAME(REPLACE(col, &#039; ,&#039;, &#039;.&#039;), 1) AS [Name]from table]]></description>
		<content:encoded><![CDATA[<p>SELECT PARSENAME(REPLACE(col, &#8216; ,&#8217;, &#8216;.&#8217;), 1) AS [Name]from table</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mahalakshmi</title>
		<link>http://blog.sqlauthority.com/2009/11/25/sql-server-comma-separated-values-csv-from-table-column/#comment-471845</link>
		<dc:creator><![CDATA[mahalakshmi]]></dc:creator>
		<pubDate>Thu, 09 May 2013 07:33:40 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=7133#comment-471845</guid>
		<description><![CDATA[SELECT PARSENAME(REPLACE(name, &#039; &#039;, &#039;.&#039;), 2) AS [FirstName],
       PARSENAME(REPLACE(name, &#039; ,&#039;, &#039;.&#039;), 1) AS [LastName]from table]]></description>
		<content:encoded><![CDATA[<p>SELECT PARSENAME(REPLACE(name, &#8216; &#8216;, &#8216;.&#8217;), 2) AS [FirstName],<br />
       PARSENAME(REPLACE(name, &#8216; ,&#8217;, &#8216;.&#8217;), 1) AS [LastName]from table</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rohit</title>
		<link>http://blog.sqlauthority.com/2009/11/25/sql-server-comma-separated-values-csv-from-table-column/#comment-436014</link>
		<dc:creator><![CDATA[Rohit]]></dc:creator>
		<pubDate>Tue, 12 Mar 2013 10:56:42 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=7133#comment-436014</guid>
		<description><![CDATA[In a table with EmployeeName column, I am having employee names in lastname, firstname format &amp; in some rows there are more that 1 employee name seperated by semicolon. How do I convert that column into firstname lastname format.]]></description>
		<content:encoded><![CDATA[<p>In a table with EmployeeName column, I am having employee names in lastname, firstname format &amp; in some rows there are more that 1 employee name seperated by semicolon. How do I convert that column into firstname lastname format.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: madhivanan</title>
		<link>http://blog.sqlauthority.com/2009/11/25/sql-server-comma-separated-values-csv-from-table-column/#comment-422131</link>
		<dc:creator><![CDATA[madhivanan]]></dc:creator>
		<pubDate>Fri, 15 Feb 2013 13:27:06 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=7133#comment-422131</guid>
		<description><![CDATA[use this approach

replace(&#039;,&#039;+col+&#039;,&#039;,&#039;,100,&#039;,&#039;,&#039;)]]></description>
		<content:encoded><![CDATA[<p>use this approach</p>
<p>replace(&#8216;,&#8217;+col+&#8217;,',&#8217;,100,&#8217;,',&#8217;)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: vgh</title>
		<link>http://blog.sqlauthority.com/2009/11/25/sql-server-comma-separated-values-csv-from-table-column/#comment-408485</link>
		<dc:creator><![CDATA[vgh]]></dc:creator>
		<pubDate>Wed, 16 Jan 2013 12:02:58 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=7133#comment-408485</guid>
		<description><![CDATA[Hi, If a column contains coma separated numbers, how to remove a particular number?
Say column &quot;ID&quot; contains  100,200,300,400,1000,2100,100
I would like to remove 100 
If I use Replace function, it would modify 1000 and 2100 as well which I don&#039;t want .
It should remove only 100 which may present at any index of the column ( 100, 200,100)
How to achieve this?]]></description>
		<content:encoded><![CDATA[<p>Hi, If a column contains coma separated numbers, how to remove a particular number?<br />
Say column &#8220;ID&#8221; contains  100,200,300,400,1000,2100,100<br />
I would like to remove 100<br />
If I use Replace function, it would modify 1000 and 2100 as well which I don&#8217;t want .<br />
It should remove only 100 which may present at any index of the column ( 100, 200,100)<br />
How to achieve this?</p>
]]></content:encoded>
	</item>
	<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/11/25/sql-server-comma-separated-values-csv-from-table-column/#comment-397389</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:58 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=7133#comment-397389</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; Weekly Series &#8211; Memory Lane &#8211; #005 &#171; SQL Server Journey with SQL Authority</title>
		<link>http://blog.sqlauthority.com/2009/11/25/sql-server-comma-separated-values-csv-from-table-column/#comment-384382</link>
		<dc:creator><![CDATA[SQL SERVER &#8211; Weekly Series &#8211; Memory Lane &#8211; #005 &#171; SQL Server Journey with SQL Authority]]></dc:creator>
		<pubDate>Sat, 01 Dec 2012 01:31:04 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=7133#comment-384382</guid>
		<description><![CDATA[[...] Comma Separated Values (CSV) from Table Column A Very common question &#8211; How to create comma separated values from a table in the database? The answer is also very common if we use XML. Check out this article for quick learning on the same subject. [...]]]></description>
		<content:encoded><![CDATA[<p>[...] Comma Separated Values (CSV) from Table Column A Very common question &#8211; How to create comma separated values from a table in the database? The answer is also very common if we use XML. Check out this article for quick learning on the same subject. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Touhid e Azhar</title>
		<link>http://blog.sqlauthority.com/2009/11/25/sql-server-comma-separated-values-csv-from-table-column/#comment-356173</link>
		<dc:creator><![CDATA[Touhid e Azhar]]></dc:creator>
		<pubDate>Fri, 05 Oct 2012 11:59:13 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=7133#comment-356173</guid>
		<description><![CDATA[Hi,
Its good one to get d value in comma. 
But my query is littel bit different:

What if I want comma sepereated value for more than two column?
Agrment                  Schedule   ThirdParty         Billing           Copmany
A001000020	1	T001000010	1	ABC
A001000020	1	T001000017	1	PQR
A001000020	1	T001000034	1	XYZ

For the above details i wanna result like

Agreement          Schedule         Thirdparty                                               Billing
A001000020           1              T001000010,T001000017, T001000034      1

Copmany
ABC,PQR,XYZ]]></description>
		<content:encoded><![CDATA[<p>Hi,<br />
Its good one to get d value in comma.<br />
But my query is littel bit different:</p>
<p>What if I want comma sepereated value for more than two column?<br />
Agrment                  Schedule   ThirdParty         Billing           Copmany<br />
A001000020	1	T001000010	1	ABC<br />
A001000020	1	T001000017	1	PQR<br />
A001000020	1	T001000034	1	XYZ</p>
<p>For the above details i wanna result like</p>
<p>Agreement          Schedule         Thirdparty                                               Billing<br />
A001000020           1              T001000010,T001000017, T001000034      1</p>
<p>Copmany<br />
ABC,PQR,XYZ</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jake</title>
		<link>http://blog.sqlauthority.com/2009/11/25/sql-server-comma-separated-values-csv-from-table-column/#comment-352410</link>
		<dc:creator><![CDATA[Jake]]></dc:creator>
		<pubDate>Mon, 24 Sep 2012 01:37:20 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=7133#comment-352410</guid>
		<description><![CDATA[I&#039;m a total SQL newbie, but I found I needed to dump some data from MS SQL to CSV and tried to hack it myself.  The frustration with my code and this code is that it doesn&#039;t create proper CSV (e.g. if you have a comma or \n in one of your fields you&#039;re screwed).  I wrote a bunch of ugly code to add quotations around each column and replace all of the newlines with spaces.  Could your solution incorporate something like that so we could get proper CSV out of MS SQL?]]></description>
		<content:encoded><![CDATA[<p>I&#8217;m a total SQL newbie, but I found I needed to dump some data from MS SQL to CSV and tried to hack it myself.  The frustration with my code and this code is that it doesn&#8217;t create proper CSV (e.g. if you have a comma or \n in one of your fields you&#8217;re screwed).  I wrote a bunch of ugly code to add quotations around each column and replace all of the newlines with spaces.  Could your solution incorporate something like that so we could get proper CSV out of MS SQL?</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/11/25/sql-server-comma-separated-values-csv-from-table-column/#comment-345086</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:33 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=7133#comment-345086</guid>
		<description><![CDATA[[...] Comma Separated Values (CSV) from Table Column [...]]]></description>
		<content:encoded><![CDATA[<p>[...] Comma Separated Values (CSV) from Table Column [...]</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/11/25/sql-server-comma-separated-values-csv-from-table-column/#comment-303405</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:01 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=7133#comment-303405</guid>
		<description><![CDATA[[...] SQL SERVER – Comma Separated Values (CSV) from Table Column [...]]]></description>
		<content:encoded><![CDATA[<p>[...] SQL SERVER – Comma Separated Values (CSV) from Table Column [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: aisha</title>
		<link>http://blog.sqlauthority.com/2009/11/25/sql-server-comma-separated-values-csv-from-table-column/#comment-293549</link>
		<dc:creator><![CDATA[aisha]]></dc:creator>
		<pubDate>Mon, 04 Jun 2012 04:15:22 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=7133#comment-293549</guid>
		<description><![CDATA[thanks.. helpful info]]></description>
		<content:encoded><![CDATA[<p>thanks.. helpful info</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lucky</title>
		<link>http://blog.sqlauthority.com/2009/11/25/sql-server-comma-separated-values-csv-from-table-column/#comment-288476</link>
		<dc:creator><![CDATA[Lucky]]></dc:creator>
		<pubDate>Fri, 25 May 2012 10:09:53 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=7133#comment-288476</guid>
		<description><![CDATA[The above would require correction that could execute perfectly]]></description>
		<content:encoded><![CDATA[<p>The above would require correction that could execute perfectly</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lucky</title>
		<link>http://blog.sqlauthority.com/2009/11/25/sql-server-comma-separated-values-csv-from-table-column/#comment-288472</link>
		<dc:creator><![CDATA[Lucky]]></dc:creator>
		<pubDate>Fri, 25 May 2012 10:04:38 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=7133#comment-288472</guid>
		<description><![CDATA[Dude this code is incorrect.]]></description>
		<content:encoded><![CDATA[<p>Dude this code is incorrect.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Suman Balguri</title>
		<link>http://blog.sqlauthority.com/2009/11/25/sql-server-comma-separated-values-csv-from-table-column/#comment-283287</link>
		<dc:creator><![CDATA[Suman Balguri]]></dc:creator>
		<pubDate>Wed, 09 May 2012 15:07:10 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=7133#comment-283287</guid>
		<description><![CDATA[Dinesh, You will end up with extra Comma..]]></description>
		<content:encoded><![CDATA[<p>Dinesh, You will end up with extra Comma..</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sahil kakkar</title>
		<link>http://blog.sqlauthority.com/2009/11/25/sql-server-comma-separated-values-csv-from-table-column/#comment-275209</link>
		<dc:creator><![CDATA[Sahil kakkar]]></dc:creator>
		<pubDate>Wed, 11 Apr 2012 20:46:36 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=7133#comment-275209</guid>
		<description><![CDATA[How to get reverse of it means if we have a variable having comma seprated vaules how to get them into a column so we can have operation on it]]></description>
		<content:encoded><![CDATA[<p>How to get reverse of it means if we have a variable having comma seprated vaules how to get them into a column so we can have operation on it</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: gokul</title>
		<link>http://blog.sqlauthority.com/2009/11/25/sql-server-comma-separated-values-csv-from-table-column/#comment-268211</link>
		<dc:creator><![CDATA[gokul]]></dc:creator>
		<pubDate>Tue, 27 Mar 2012 06:49:46 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=7133#comment-268211</guid>
		<description><![CDATA[i have two table named parent and child parent table have PID which is primary key declared as  foreign key for child table i want to display results like 

PID     ChildID

1        1,2,3
2        4,5

Is it possible for group_concat for two tables in sql 2008 ?]]></description>
		<content:encoded><![CDATA[<p>i have two table named parent and child parent table have PID which is primary key declared as  foreign key for child table i want to display results like </p>
<p>PID     ChildID</p>
<p>1        1,2,3<br />
2        4,5</p>
<p>Is it possible for group_concat for two tables in sql 2008 ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: yeong</title>
		<link>http://blog.sqlauthority.com/2009/11/25/sql-server-comma-separated-values-csv-from-table-column/#comment-263648</link>
		<dc:creator><![CDATA[yeong]]></dc:creator>
		<pubDate>Fri, 16 Mar 2012 09:09:05 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=7133#comment-263648</guid>
		<description><![CDATA[How to do a select statement for value stored in comma separated in db.]]></description>
		<content:encoded><![CDATA[<p>How to do a select statement for value stored in comma separated in db.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: AnilKumar</title>
		<link>http://blog.sqlauthority.com/2009/11/25/sql-server-comma-separated-values-csv-from-table-column/#comment-263521</link>
		<dc:creator><![CDATA[AnilKumar]]></dc:creator>
		<pubDate>Fri, 16 Mar 2012 04:05:02 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=7133#comment-263521</guid>
		<description><![CDATA[My Table is Like below
Create table ABC (column nvarchar(2000))

insert ABC values (&#039;ab1&#124;ab2&#124;ab3&#124;ab4&#124;ab5&#124;ab6&#124;ab7&#124;ab8&#039;)

insert ABC values (&#039;bc1&#124;bc2&#124;bc3&#124;bc4&#124;bc5&#124;bc6&#124;bc7&#124;bc8&#039;)

here i want only display like below 

ComnnXYZ
ab7
bc7]]></description>
		<content:encoded><![CDATA[<p>My Table is Like below<br />
Create table ABC (column nvarchar(2000))</p>
<p>insert ABC values (&#8216;ab1|ab2|ab3|ab4|ab5|ab6|ab7|ab8&#8242;)</p>
<p>insert ABC values (&#8216;bc1|bc2|bc3|bc4|bc5|bc6|bc7|bc8&#8242;)</p>
<p>here i want only display like below </p>
<p>ComnnXYZ<br />
ab7<br />
bc7</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jay</title>
		<link>http://blog.sqlauthority.com/2009/11/25/sql-server-comma-separated-values-csv-from-table-column/#comment-255941</link>
		<dc:creator><![CDATA[jay]]></dc:creator>
		<pubDate>Thu, 23 Feb 2012 21:00:29 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=7133#comment-255941</guid>
		<description><![CDATA[found something even more easy

http://geekswithblogs.net/mnf/archive/2007/10/02/t-sql-user-defined-function-to-concatenate-column-to-csv-string.aspx

SELECT STUFF((SELECT &#039;,&#039; + Table.ColumnName FROM Table FOR XML PATH(&#039;&#039;)),1, 1, &#039;&#039;) AS CSVColumn]]></description>
		<content:encoded><![CDATA[<p>found something even more easy</p>
<p><a href="http://geekswithblogs.net/mnf/archive/2007/10/02/t-sql-user-defined-function-to-concatenate-column-to-csv-string.aspx" rel="nofollow">http://geekswithblogs.net/mnf/archive/2007/10/02/t-sql-user-defined-function-to-concatenate-column-to-csv-string.aspx</a></p>
<p>SELECT STUFF((SELECT &#8216;,&#8217; + Table.ColumnName FROM Table FOR XML PATH(&#8221;)),1, 1, &#8221;) AS CSVColumn</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Santosh Varma</title>
		<link>http://blog.sqlauthority.com/2009/11/25/sql-server-comma-separated-values-csv-from-table-column/#comment-245646</link>
		<dc:creator><![CDATA[Santosh Varma]]></dc:creator>
		<pubDate>Mon, 30 Jan 2012 09:37:11 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=7133#comment-245646</guid>
		<description><![CDATA[Pinal Dave,

               I have the following query:


SELECT  
c.CompanyID,
c.CompanyName,
ISNULL(c.LogoFileName,&#039;&#039;) AS LogoFileName,
ISNULL(c.City,&#039;&#039;) AS City, 
ISNULL(s.strState,&#039;&#039;) as [State], 
ISNULL(m.Mode,&#039;&#039;) as Mode             
     FROM tblCompany c         
     INNER JOIN tblCompanyPartners tcmp on c.CompanyID = tcmp.PartnerCompanyID         
     LEFT OUTER JOIN tblStates s ON C.StateID = S.intStateID              
     LEFT OUTER JOIN tblCompanyModes cm on c.CompanyID = cm.CompanyID              
     LEFT OUTER JOIN tblMode m ON cm.ModeID = m.ModeID WHERE c.PartnerTypeID IN (1,2) 
     AND C.CompanyID 31 
     and c.CompanyID not in (select PartnerCompanyID from tblCompanyCarrierPartners where [Status] IN (&#039;Blocked&#039;,&#039;Requested&#039;,&#039;Accepted&#039;) and tblCompanyCarrierPartners.CompanyID = 31) order by companyid desc


The following result is returned:

18  christ carrier company file1  San Jose  New Hampshire	LTL
18  christ carrier company file1  San Jose  New Hampshire     Oversize
14  Milton  	          file2  Dallas       California	Intermodal


Now, I need to get the following result:

18  christ carrier company file1  San Jose  New Hampshire     LTL, Oversize
14  Milton  	          file2  Dallas       California	Intermodal

I am really stuck up with this task.  Any help is appreciated.

Thanks,
Varma]]></description>
		<content:encoded><![CDATA[<p>Pinal Dave,</p>
<p>               I have the following query:</p>
<p>SELECT<br />
c.CompanyID,<br />
c.CompanyName,<br />
ISNULL(c.LogoFileName,&#8221;) AS LogoFileName,<br />
ISNULL(c.City,&#8221;) AS City,<br />
ISNULL(s.strState,&#8221;) as [State],<br />
ISNULL(m.Mode,&#8221;) as Mode<br />
     FROM tblCompany c<br />
     INNER JOIN tblCompanyPartners tcmp on c.CompanyID = tcmp.PartnerCompanyID<br />
     LEFT OUTER JOIN tblStates s ON C.StateID = S.intStateID<br />
     LEFT OUTER JOIN tblCompanyModes cm on c.CompanyID = cm.CompanyID<br />
     LEFT OUTER JOIN tblMode m ON cm.ModeID = m.ModeID WHERE c.PartnerTypeID IN (1,2)<br />
     AND C.CompanyID 31<br />
     and c.CompanyID not in (select PartnerCompanyID from tblCompanyCarrierPartners where [Status] IN (&#8216;Blocked&#8217;,'Requested&#8217;,'Accepted&#8217;) and tblCompanyCarrierPartners.CompanyID = 31) order by companyid desc</p>
<p>The following result is returned:</p>
<p>18  christ carrier company file1  San Jose  New Hampshire	LTL<br />
18  christ carrier company file1  San Jose  New Hampshire     Oversize<br />
14  Milton  	          file2  Dallas       California	Intermodal</p>
<p>Now, I need to get the following result:</p>
<p>18  christ carrier company file1  San Jose  New Hampshire     LTL, Oversize<br />
14  Milton  	          file2  Dallas       California	Intermodal</p>
<p>I am really stuck up with this task.  Any help is appreciated.</p>
<p>Thanks,<br />
Varma</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Khan</title>
		<link>http://blog.sqlauthority.com/2009/11/25/sql-server-comma-separated-values-csv-from-table-column/#comment-227915</link>
		<dc:creator><![CDATA[Khan]]></dc:creator>
		<pubDate>Thu, 29 Dec 2011 10:38:17 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=7133#comment-227915</guid>
		<description><![CDATA[I HAVE THE BELOW SCRIPT 

select DISTINCT expiry from Rec_Dtl where grn_number =27964 and m_code =&#039;M605&#039;

THE RERSUTLS  ARE

exiry
-------
382268;  07/02/05
976131,  31/05/2011


I WANT THE SEPRATE TWO VALUES LIKE BELOW.

DISTINCT EXPIRY 1 , EXPRIY 2
-------------------------------------
                  382268          07/02/05
                  976131         31/05/2011
 
I WANT RESULTS EXACTLY LIKE ABOVE. PLEASE HELP ME.]]></description>
		<content:encoded><![CDATA[<p>I HAVE THE BELOW SCRIPT </p>
<p>select DISTINCT expiry from Rec_Dtl where grn_number =27964 and m_code =&#8217;M605&#8242;</p>
<p>THE RERSUTLS  ARE</p>
<p>exiry<br />
&#8212;&#8212;-<br />
382268;  07/02/05<br />
976131,  31/05/2011</p>
<p>I WANT THE SEPRATE TWO VALUES LIKE BELOW.</p>
<p>DISTINCT EXPIRY 1 , EXPRIY 2<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
                  382268          07/02/05<br />
                  976131         31/05/2011</p>
<p>I WANT RESULTS EXACTLY LIKE ABOVE. PLEASE HELP ME.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: davidn</title>
		<link>http://blog.sqlauthority.com/2009/11/25/sql-server-comma-separated-values-csv-from-table-column/#comment-201979</link>
		<dc:creator><![CDATA[davidn]]></dc:creator>
		<pubDate>Tue, 22 Nov 2011 07:05:40 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=7133#comment-201979</guid>
		<description><![CDATA[For anybody that had the issue of any ampersands being entitized as &quot;&amp; amp;&quot; in your query result - see below for the syntax. That baked my head for a few hours. It uses the xquery .value to convert back to Nvarchar to avoid that issue. Example below Field1 is the key and FieldText is the one I want to summarize as a comma separated value list.

SELECT DISTINCT tm.Field1

STUFF(( SELECT DISTINCT &#039;, &#039; + [FieldText] as [text()]
			FROM Table1 ts
			WHERE tm.Field1 = ts.Field1
			FOR XML path(&#039;&#039;), TYPE
			).value(N&#039;.&#039;, N&#039;nvarchar(max)&#039;), 1, 1,&#039;&#039;) as Field1CSV

FROM Table1 tm]]></description>
		<content:encoded><![CDATA[<p>For anybody that had the issue of any ampersands being entitized as &#8220;&amp; amp;&#8221; in your query result &#8211; see below for the syntax. That baked my head for a few hours. It uses the xquery .value to convert back to Nvarchar to avoid that issue. Example below Field1 is the key and FieldText is the one I want to summarize as a comma separated value list.</p>
<p>SELECT DISTINCT tm.Field1</p>
<p>STUFF(( SELECT DISTINCT &#8216;, &#8216; + [FieldText] as [text()]<br />
			FROM Table1 ts<br />
			WHERE tm.Field1 = ts.Field1<br />
			FOR XML path(&#8221;), TYPE<br />
			).value(N&#8217;.', N&#8217;nvarchar(max)&#8217;), 1, 1,&#8221;) as Field1CSV</p>
<p>FROM Table1 tm</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: madhivanan</title>
		<link>http://blog.sqlauthority.com/2009/11/25/sql-server-comma-separated-values-csv-from-table-column/#comment-187109</link>
		<dc:creator><![CDATA[madhivanan]]></dc:creator>
		<pubDate>Wed, 02 Nov 2011 14:36:59 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=7133#comment-187109</guid>
		<description><![CDATA[Refer this method
http://beyondrelational.com/blogs/madhivanan/archive/2008/09/11/splitting-delimited-data-to-columns-set-based-approach.aspx]]></description>
		<content:encoded><![CDATA[<p>Refer this method<br />
<a href="http://beyondrelational.com/blogs/madhivanan/archive/2008/09/11/splitting-delimited-data-to-columns-set-based-approach.aspx" rel="nofollow">http://beyondrelational.com/blogs/madhivanan/archive/2008/09/11/splitting-delimited-data-to-columns-set-based-approach.aspx</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: madhivanan</title>
		<link>http://blog.sqlauthority.com/2009/11/25/sql-server-comma-separated-values-csv-from-table-column/#comment-187108</link>
		<dc:creator><![CDATA[madhivanan]]></dc:creator>
		<pubDate>Wed, 02 Nov 2011 14:35:59 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=7133#comment-187108</guid>
		<description><![CDATA[Refer this. It will solve your problem
http://beyondrelational.com/blogs/madhivanan/archive/2010/03/17/bulk-insert-to-table-with-specific-columns.aspx]]></description>
		<content:encoded><![CDATA[<p>Refer this. It will solve your problem<br />
<a href="http://beyondrelational.com/blogs/madhivanan/archive/2010/03/17/bulk-insert-to-table-with-specific-columns.aspx" rel="nofollow">http://beyondrelational.com/blogs/madhivanan/archive/2010/03/17/bulk-insert-to-table-with-specific-columns.aspx</a></p>
]]></content:encoded>
	</item>
</channel>
</rss>
