<?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/"
		>
<channel>
	<title>Comments on: SQLXML : How To Save XML Query Results to a File Using BCP</title>
	<atom:link href="http://www.sqlmusings.com/2009/03/21/sqlxml-how-to-save-xml-query-results-to-a-file-using-bcp/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.sqlmusings.com/2009/03/21/sqlxml-how-to-save-xml-query-results-to-a-file-using-bcp/</link>
	<description>ramblings, discoveries, tutorials on sql server and other database stuff</description>
	<lastBuildDate>Wed, 10 Mar 2010 20:35:13 -0700</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Andrew</title>
		<link>http://www.sqlmusings.com/2009/03/21/sqlxml-how-to-save-xml-query-results-to-a-file-using-bcp/comment-page-1/#comment-1444</link>
		<dc:creator>Andrew</dc:creator>
		<pubDate>Fri, 17 Jul 2009 02:35:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.sqlmusings.com/2009/03/21/sqlxml-how-to-save-xml-query-results-to-a-file-using-bcp/#comment-1444</guid>
		<description>This is very cool ... thanks so much for posting this.</description>
		<content:encoded><![CDATA[<p>This is very cool &#8230; thanks so much for posting this.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: emime</title>
		<link>http://www.sqlmusings.com/2009/03/21/sqlxml-how-to-save-xml-query-results-to-a-file-using-bcp/comment-page-1/#comment-1356</link>
		<dc:creator>emime</dc:creator>
		<pubDate>Fri, 03 Jul 2009 09:13:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.sqlmusings.com/2009/03/21/sqlxml-how-to-save-xml-query-results-to-a-file-using-bcp/#comment-1356</guid>
		<description>I want to add a very important note. With bigger result sets I got a line brakes (and consequently the stored xml corrupted). The only thing that solved the problem was to add the options -r -t without argument. This instructs bps to override newline (default \n) and tab (default \t) with a null character (that is your final xml will not have line brakes or tabs but will be well formed!!!).
Furthermore, you can use batch to fix the limit size. Here the final instruction fragment for the bcp I used:
&lt;code&gt;
SELECT  @SQLCmd = &#039;bcp ... queryout ... -w -r -t -b 4000&#039;
&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>I want to add a very important note. With bigger result sets I got a line brakes (and consequently the stored xml corrupted). The only thing that solved the problem was to add the options -r -t without argument. This instructs bps to override newline (default \n) and tab (default \t) with a null character (that is your final xml will not have line brakes or tabs but will be well formed!!!).<br />
Furthermore, you can use batch to fix the limit size. Here the final instruction fragment for the bcp I used:<br />
<code><br />
SELECT  @SQLCmd = 'bcp ... queryout ... -w -r -t -b 4000'<br />
</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: emime</title>
		<link>http://www.sqlmusings.com/2009/03/21/sqlxml-how-to-save-xml-query-results-to-a-file-using-bcp/comment-page-1/#comment-1350</link>
		<dc:creator>emime</dc:creator>
		<pubDate>Thu, 02 Jul 2009 16:01:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.sqlmusings.com/2009/03/21/sqlxml-how-to-save-xml-query-results-to-a-file-using-bcp/#comment-1350</guid>
		<description>Thanks, it&#039;s useful and worked for me. 
Just a note:
* the -S option is required only in case of remote execution of bpc. I had to cut it.
* VARCHAR(500) may be too much limiting</description>
		<content:encoded><![CDATA[<p>Thanks, it&#8217;s useful and worked for me.<br />
Just a note:<br />
* the -S option is required only in case of remote execution of bpc. I had to cut it.<br />
* VARCHAR(500) may be too much limiting</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: belle</title>
		<link>http://www.sqlmusings.com/2009/03/21/sqlxml-how-to-save-xml-query-results-to-a-file-using-bcp/comment-page-1/#comment-1017</link>
		<dc:creator>belle</dc:creator>
		<pubDate>Fri, 29 May 2009 18:55:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.sqlmusings.com/2009/03/21/sqlxml-how-to-save-xml-query-results-to-a-file-using-bcp/#comment-1017</guid>
		<description>Thanks John! :) Happy to hear that!</description>
		<content:encoded><![CDATA[<p>Thanks John! <img src='http://www.sqlmusings.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Happy to hear that!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John</title>
		<link>http://www.sqlmusings.com/2009/03/21/sqlxml-how-to-save-xml-query-results-to-a-file-using-bcp/comment-page-1/#comment-1016</link>
		<dc:creator>John</dc:creator>
		<pubDate>Fri, 29 May 2009 18:33:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.sqlmusings.com/2009/03/21/sqlxml-how-to-save-xml-query-results-to-a-file-using-bcp/#comment-1016</guid>
		<description>Less is more. Besides being short, sweet, and very elegant I use the little script in processing my XML almost every day.

Keep it up Belle!</description>
		<content:encoded><![CDATA[<p>Less is more. Besides being short, sweet, and very elegant I use the little script in processing my XML almost every day.</p>
<p>Keep it up Belle!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sergei</title>
		<link>http://www.sqlmusings.com/2009/03/21/sqlxml-how-to-save-xml-query-results-to-a-file-using-bcp/comment-page-1/#comment-170</link>
		<dc:creator>Sergei</dc:creator>
		<pubDate>Thu, 23 Apr 2009 23:21:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.sqlmusings.com/2009/03/21/sqlxml-how-to-save-xml-query-results-to-a-file-using-bcp/#comment-170</guid>
		<description>Thank you! It is very useful (at least to me).</description>
		<content:encoded><![CDATA[<p>Thank you! It is very useful (at least to me).</p>
]]></content:encoded>
	</item>
</channel>
</rss>
