<?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; Tips from the SQL Joes 2 Pros Development Series &#8211; Using Root With Auto XML Mode &#8211; Day 32 of 35</title>
	<atom:link href="http://blog.sqlauthority.com/2011/09/01/sql-server-tips-from-the-sql-joes-2-pros-development-series-using-root-with-auto-xml-mode-day-32-of-35/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.sqlauthority.com/2011/09/01/sql-server-tips-from-the-sql-joes-2-pros-development-series-using-root-with-auto-xml-mode-day-32-of-35/</link>
	<description>Personal Notes of Pinal Dave</description>
	<lastBuildDate>Fri, 17 May 2013 15:26:57 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: SQL SERVER &#8211; Understanding XML &#8211; Contest Win Joes 2 Pros Combo (USD 198) &#8211; Day 5 of 5 &#171; SQL Server Journey with SQL Authority</title>
		<link>http://blog.sqlauthority.com/2011/09/01/sql-server-tips-from-the-sql-joes-2-pros-development-series-using-root-with-auto-xml-mode-day-32-of-35/#comment-327989</link>
		<dc:creator><![CDATA[SQL SERVER &#8211; Understanding XML &#8211; Contest Win Joes 2 Pros Combo (USD 198) &#8211; Day 5 of 5 &#171; SQL Server Journey with SQL Authority]]></dc:creator>
		<pubDate>Fri, 10 Aug 2012 01:31:53 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=14135#comment-327989</guid>
		<description><![CDATA[[...] SQL Joes 2 Pros Development Series – Using Root With Auto XML Mode [...]]]></description>
		<content:encoded><![CDATA[<p>[...] SQL Joes 2 Pros Development Series – Using Root With Auto XML Mode [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SQL SERVER – A Guide to Integrating SQL Server with XML, C#, and PowerShell – Book Available for SQL Server Certification Journey to SQLAuthority</title>
		<link>http://blog.sqlauthority.com/2011/09/01/sql-server-tips-from-the-sql-joes-2-pros-development-series-using-root-with-auto-xml-mode-day-32-of-35/#comment-166104</link>
		<dc:creator><![CDATA[SQL SERVER – A Guide to Integrating SQL Server with XML, C#, and PowerShell – Book Available for SQL Server Certification Journey to SQLAuthority]]></dc:creator>
		<pubDate>Wed, 07 Sep 2011 02:13:46 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=14135#comment-166104</guid>
		<description><![CDATA[[...]  [...]]]></description>
		<content:encoded><![CDATA[<p>[...]  [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mahesh MS</title>
		<link>http://blog.sqlauthority.com/2011/09/01/sql-server-tips-from-the-sql-joes-2-pros-development-series-using-root-with-auto-xml-mode-day-32-of-35/#comment-165952</link>
		<dc:creator><![CDATA[mahesh MS]]></dc:creator>
		<pubDate>Tue, 06 Sep 2011 11:33:35 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=14135#comment-165952</guid>
		<description><![CDATA[Correct Answer is  4.

4. SELECT Price [@Price], ProductName AS [*]
FROM CurrentProducts
FOR XML PATH(‘Product’), ROOT(‘ProductExport’) 

ROOT(‘ProductExport’)  will add &quot;ProductExport&quot; root tag and FOR XML PATH(‘Product’) will replace &quot;Row&quot; tag with &quot;Product&quot; for each row.

@Price will be added as attribute and ProductName value will placed directly in &quot;Product&quot; tag.

Regards
Mahesh

From India.]]></description>
		<content:encoded><![CDATA[<p>Correct Answer is  4.</p>
<p>4. SELECT Price [@Price], ProductName AS [*]<br />
FROM CurrentProducts<br />
FOR XML PATH(‘Product’), ROOT(‘ProductExport’) </p>
<p>ROOT(‘ProductExport’)  will add &#8220;ProductExport&#8221; root tag and FOR XML PATH(‘Product’) will replace &#8220;Row&#8221; tag with &#8220;Product&#8221; for each row.</p>
<p>@Price will be added as attribute and ProductName value will placed directly in &#8220;Product&#8221; tag.</p>
<p>Regards<br />
Mahesh</p>
<p>From India.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Azhar Iqbal</title>
		<link>http://blog.sqlauthority.com/2011/09/01/sql-server-tips-from-the-sql-joes-2-pros-development-series-using-root-with-auto-xml-mode-day-32-of-35/#comment-165565</link>
		<dc:creator><![CDATA[Azhar Iqbal]]></dc:creator>
		<pubDate>Mon, 05 Sep 2011 05:44:04 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=14135#comment-165565</guid>
		<description><![CDATA[Option 4 is Correct.
Country
Pakistan]]></description>
		<content:encoded><![CDATA[<p>Option 4 is Correct.<br />
Country<br />
Pakistan</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: pinaldave</title>
		<link>http://blog.sqlauthority.com/2011/09/01/sql-server-tips-from-the-sql-joes-2-pros-development-series-using-root-with-auto-xml-mode-day-32-of-35/#comment-165028</link>
		<dc:creator><![CDATA[pinaldave]]></dc:creator>
		<pubDate>Sat, 03 Sep 2011 07:10:23 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=14135#comment-165028</guid>
		<description><![CDATA[&lt;p style=&quot;text-align:justify;&quot;&gt;A.) 4. SELECT Price [@Price], ProductName AS [*]
FROM CurrentProducts
FOR XML PATH(‘Product’), ROOT(‘ProductExport’) &lt;/p&gt;
&lt;p style=&quot;text-align:justify;&quot;&gt;Winner from USA: &lt;b&gt;&lt;a href=&quot;http://blog.sqlauthority.com/2011/09/01/sql-server-tips-from-the-sql-joes-2-pros-development-series-using-root-with-auto-xml-mode-day-32-of-35/#comment-164332&quot; rel=&quot;nofollow&quot;&gt;Kevin Scharnhorst&lt;/a&gt;&lt;/b&gt;&lt;/p&gt;
&lt;p style=&quot;text-align:justify;&quot;&gt;Winner from India: &lt;b&gt;&lt;a href=&quot;http://blog.sqlauthority.com/2011/09/01/sql-server-tips-from-the-sql-joes-2-pros-development-series-using-root-with-auto-xml-mode-day-32-of-35/#comment-164278&quot; rel=&quot;nofollow&quot;&gt;Geetanjali Agarwal&lt;/a&gt;&lt;/b&gt;&lt;/p&gt;


I thank you all for participating here. The permanent record of this update is posted on &lt;a href=&quot;http://www.facebook.com/SQLAuth?sk=app_179191362131547&quot; rel=&quot;nofollow&quot;&gt;facebook&lt;/a&gt; page.]]></description>
		<content:encoded><![CDATA[<p style="text-align:justify;">A.) 4. SELECT Price [@Price], ProductName AS [*]<br />
FROM CurrentProducts<br />
FOR XML PATH(‘Product’), ROOT(‘ProductExport’) </p>
<p style="text-align:justify;">Winner from USA: <b><a href="http://blog.sqlauthority.com/2011/09/01/sql-server-tips-from-the-sql-joes-2-pros-development-series-using-root-with-auto-xml-mode-day-32-of-35/#comment-164332" rel="nofollow">Kevin Scharnhorst</a></b></p>
<p style="text-align:justify;">Winner from India: <b><a href="http://blog.sqlauthority.com/2011/09/01/sql-server-tips-from-the-sql-joes-2-pros-development-series-using-root-with-auto-xml-mode-day-32-of-35/#comment-164278" rel="nofollow">Geetanjali Agarwal</a></b></p>
<p>I thank you all for participating here. The permanent record of this update is posted on <a href="http://www.facebook.com/SQLAuth?sk=app_179191362131547" rel="nofollow">facebook</a> page.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rajesh Mohanrangan</title>
		<link>http://blog.sqlauthority.com/2011/09/01/sql-server-tips-from-the-sql-joes-2-pros-development-series-using-root-with-auto-xml-mode-day-32-of-35/#comment-164753</link>
		<dc:creator><![CDATA[Rajesh Mohanrangan]]></dc:creator>
		<pubDate>Fri, 02 Sep 2011 11:13:59 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=14135#comment-164753</guid>
		<description><![CDATA[Correct Answer is # 4.

4. SELECT Price [@Price], ProductName AS [*]
FROM CurrentProducts
FOR XML PATH(‘Product’), ROOT(‘ProductExport’) 

Regards
Rajesh
From india]]></description>
		<content:encoded><![CDATA[<p>Correct Answer is # 4.</p>
<p>4. SELECT Price [@Price], ProductName AS [*]<br />
FROM CurrentProducts<br />
FOR XML PATH(‘Product’), ROOT(‘ProductExport’) </p>
<p>Regards<br />
Rajesh<br />
From india</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: madhivanan</title>
		<link>http://blog.sqlauthority.com/2011/09/01/sql-server-tips-from-the-sql-joes-2-pros-development-series-using-root-with-auto-xml-mode-day-32-of-35/#comment-164683</link>
		<dc:creator><![CDATA[madhivanan]]></dc:creator>
		<pubDate>Fri, 02 Sep 2011 08:00:04 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=14135#comment-164683</guid>
		<description><![CDATA[Option 4

4.SELECT Price [@Price], ProductName AS [*]
FROM CurrentProducts
FOR XML PATH(‘Product’), ROOT(‘ProductExport’)

Country:India]]></description>
		<content:encoded><![CDATA[<p>Option 4</p>
<p>4.SELECT Price [@Price], ProductName AS [*]<br />
FROM CurrentProducts<br />
FOR XML PATH(‘Product’), ROOT(‘ProductExport’)</p>
<p>Country:India</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sreejith Vijayan</title>
		<link>http://blog.sqlauthority.com/2011/09/01/sql-server-tips-from-the-sql-joes-2-pros-development-series-using-root-with-auto-xml-mode-day-32-of-35/#comment-164667</link>
		<dc:creator><![CDATA[Sreejith Vijayan]]></dc:creator>
		<pubDate>Fri, 02 Sep 2011 07:17:13 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=14135#comment-164667</guid>
		<description><![CDATA[Correct answer is #4.
SELECT Price [@Price], ProductName AS [*]
FROM CurrentProducts
FOR XML PATH(‘Product’), ROOT(‘ProductExport’)

Sreejith Vijayan
Kerala
India]]></description>
		<content:encoded><![CDATA[<p>Correct answer is #4.<br />
SELECT Price [@Price], ProductName AS [*]<br />
FROM CurrentProducts<br />
FOR XML PATH(‘Product’), ROOT(‘ProductExport’)</p>
<p>Sreejith Vijayan<br />
Kerala<br />
India</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nakul Vachhrajani</title>
		<link>http://blog.sqlauthority.com/2011/09/01/sql-server-tips-from-the-sql-joes-2-pros-development-series-using-root-with-auto-xml-mode-day-32-of-35/#comment-164626</link>
		<dc:creator><![CDATA[Nakul Vachhrajani]]></dc:creator>
		<pubDate>Fri, 02 Sep 2011 05:06:11 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=14135#comment-164626</guid>
		<description><![CDATA[Correct answer is #4.
Reasons are very well explained in the article.

Country of residence: India]]></description>
		<content:encoded><![CDATA[<p>Correct answer is #4.<br />
Reasons are very well explained in the article.</p>
<p>Country of residence: India</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pankaj</title>
		<link>http://blog.sqlauthority.com/2011/09/01/sql-server-tips-from-the-sql-joes-2-pros-development-series-using-root-with-auto-xml-mode-day-32-of-35/#comment-164613</link>
		<dc:creator><![CDATA[Pankaj]]></dc:creator>
		<pubDate>Fri, 02 Sep 2011 04:41:11 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=14135#comment-164613</guid>
		<description><![CDATA[Correct Option is : 4

As per requirement Root element ProductExport and have to set attribute product price on product element.

Option 4 is the only answer to get it.


Thanks,]]></description>
		<content:encoded><![CDATA[<p>Correct Option is : 4</p>
<p>As per requirement Root element ProductExport and have to set attribute product price on product element.</p>
<p>Option 4 is the only answer to get it.</p>
<p>Thanks,</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sravan</title>
		<link>http://blog.sqlauthority.com/2011/09/01/sql-server-tips-from-the-sql-joes-2-pros-development-series-using-root-with-auto-xml-mode-day-32-of-35/#comment-164575</link>
		<dc:creator><![CDATA[sravan]]></dc:creator>
		<pubDate>Fri, 02 Sep 2011 02:57:17 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=14135#comment-164575</guid>
		<description><![CDATA[the correct option is 4

I&#039;m from INDIA]]></description>
		<content:encoded><![CDATA[<p>the correct option is 4</p>
<p>I&#8217;m from INDIA</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Deb</title>
		<link>http://blog.sqlauthority.com/2011/09/01/sql-server-tips-from-the-sql-joes-2-pros-development-series-using-root-with-auto-xml-mode-day-32-of-35/#comment-164484</link>
		<dc:creator><![CDATA[Deb]]></dc:creator>
		<pubDate>Fri, 02 Sep 2011 00:28:50 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=14135#comment-164484</guid>
		<description><![CDATA[The answer is # 4.

SELECT Price [@Price], ProductName AS [*]
FROM CurrentProducts
FOR XML PATH(‘Product’), ROOT(‘ProductExport’) 

The desired output is 

Product1
Product2
Product3
Product4


so you need 

[@Price] to get price to show up as an attribute
For the tag to appear as &quot;Product&quot; and not row you need the Path(&#039;Product&#039;)
For the root level tag to read &quot;ProductExport&quot; you need ROOT(&#039;ProductExport&#039;)

#4 is the only one that has all these pieces that will get your xml to appear as you requested

Deb -USA]]></description>
		<content:encoded><![CDATA[<p>The answer is # 4.</p>
<p>SELECT Price [@Price], ProductName AS [*]<br />
FROM CurrentProducts<br />
FOR XML PATH(‘Product’), ROOT(‘ProductExport’) </p>
<p>The desired output is </p>
<p>Product1<br />
Product2<br />
Product3<br />
Product4</p>
<p>so you need </p>
<p>[@Price] to get price to show up as an attribute<br />
For the tag to appear as &#8220;Product&#8221; and not row you need the Path(&#8216;Product&#8217;)<br />
For the root level tag to read &#8220;ProductExport&#8221; you need ROOT(&#8216;ProductExport&#8217;)</p>
<p>#4 is the only one that has all these pieces that will get your xml to appear as you requested</p>
<p>Deb -USA</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dilipkumarjena</title>
		<link>http://blog.sqlauthority.com/2011/09/01/sql-server-tips-from-the-sql-joes-2-pros-development-series-using-root-with-auto-xml-mode-day-32-of-35/#comment-164391</link>
		<dc:creator><![CDATA[dilipkumarjena]]></dc:creator>
		<pubDate>Thu, 01 Sep 2011 18:23:10 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=14135#comment-164391</guid>
		<description><![CDATA[Correct option for the above question is Option 4 .

4.	SELECT Price [@Price], ProductName AS [*]
FROM CurrentProducts
FOR XML PATH(‘Product’), ROOT(‘ProductExport’)

Why ?
because provides the output that was requested. This is the correct choice.


Option #1 is aliasing the table CurrentProductas as ProductExport. This is not going give a result stream with a root node of ProductExport. Hence INVALID

Option #2 Gives a root node of ProductExport, but doesn’t provide the Product tag.Hence invalid.

Option #3 It doesn’t provide a root node. Hence Invalid


DILIP KUMAR JENA
Country: INIDA]]></description>
		<content:encoded><![CDATA[<p>Correct option for the above question is Option 4 .</p>
<p>4.	SELECT Price [@Price], ProductName AS [*]<br />
FROM CurrentProducts<br />
FOR XML PATH(‘Product’), ROOT(‘ProductExport’)</p>
<p>Why ?<br />
because provides the output that was requested. This is the correct choice.</p>
<p>Option #1 is aliasing the table CurrentProductas as ProductExport. This is not going give a result stream with a root node of ProductExport. Hence INVALID</p>
<p>Option #2 Gives a root node of ProductExport, but doesn’t provide the Product tag.Hence invalid.</p>
<p>Option #3 It doesn’t provide a root node. Hence Invalid</p>
<p>DILIP KUMAR JENA<br />
Country: INIDA</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: haresh ambaliya</title>
		<link>http://blog.sqlauthority.com/2011/09/01/sql-server-tips-from-the-sql-joes-2-pros-development-series-using-root-with-auto-xml-mode-day-32-of-35/#comment-164386</link>
		<dc:creator><![CDATA[haresh ambaliya]]></dc:creator>
		<pubDate>Thu, 01 Sep 2011 18:03:13 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=14135#comment-164386</guid>
		<description><![CDATA[Correct Ans is: #4

SELECT Price [@Price], ProductName AS [*]
FROM CurrentProducts
FOR XML PATH(‘Product’), ROOT(‘ProductExport’)

Because, we want path as product and root element as ProductExport.
In alternet querys there is not path name, root name specified.


-- 
Haresh Ambaliya (INDIA)]]></description>
		<content:encoded><![CDATA[<p>Correct Ans is: #4</p>
<p>SELECT Price [@Price], ProductName AS [*]<br />
FROM CurrentProducts<br />
FOR XML PATH(‘Product’), ROOT(‘ProductExport’)</p>
<p>Because, we want path as product and root element as ProductExport.<br />
In alternet querys there is not path name, root name specified.</p>
<p>&#8211;<br />
Haresh Ambaliya (INDIA)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Vaishali Jain</title>
		<link>http://blog.sqlauthority.com/2011/09/01/sql-server-tips-from-the-sql-joes-2-pros-development-series-using-root-with-auto-xml-mode-day-32-of-35/#comment-164381</link>
		<dc:creator><![CDATA[Vaishali Jain]]></dc:creator>
		<pubDate>Thu, 01 Sep 2011 17:46:57 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=14135#comment-164381</guid>
		<description><![CDATA[Correct answer is option 4.

This query includes xml clause for root element (ProductExport), and each xml element(Product) within it. It also has @Price attribute defined for Price column which matches all the criteria defined for generating the xml displayed

Vaishali Jain
Country of Residence: Hyderabad, India.]]></description>
		<content:encoded><![CDATA[<p>Correct answer is option 4.</p>
<p>This query includes xml clause for root element (ProductExport), and each xml element(Product) within it. It also has @Price attribute defined for Price column which matches all the criteria defined for generating the xml displayed</p>
<p>Vaishali Jain<br />
Country of Residence: Hyderabad, India.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sale A. A.</title>
		<link>http://blog.sqlauthority.com/2011/09/01/sql-server-tips-from-the-sql-joes-2-pros-development-series-using-root-with-auto-xml-mode-day-32-of-35/#comment-164370</link>
		<dc:creator><![CDATA[Sale A. A.]]></dc:creator>
		<pubDate>Thu, 01 Sep 2011 16:54:41 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=14135#comment-164370</guid>
		<description><![CDATA[The correct  Option 4) SELECT Price [@Price], ProductName AS [*]
FROM CurrentProducts
FOR XML PATH(‘Product’), ROOT(‘ProductExport’).               
(Sale, Nigeria]]></description>
		<content:encoded><![CDATA[<p>The correct  Option 4) SELECT Price [@Price], ProductName AS [*]<br />
FROM CurrentProducts<br />
FOR XML PATH(‘Product’), ROOT(‘ProductExport’).<br />
(Sale, Nigeria</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Hema Chaudhry</title>
		<link>http://blog.sqlauthority.com/2011/09/01/sql-server-tips-from-the-sql-joes-2-pros-development-series-using-root-with-auto-xml-mode-day-32-of-35/#comment-164363</link>
		<dc:creator><![CDATA[Hema Chaudhry]]></dc:creator>
		<pubDate>Thu, 01 Sep 2011 16:23:21 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=14135#comment-164363</guid>
		<description><![CDATA[Hi,

The correct answer is  Option 4

SELECT Price [@Price], ProductName AS [*]
FROM CurrentProducts
FOR XML PATH(‘Product’), ROOT(‘ProductExport’)

Explanation is -

As per the question the requirements are-

Root node name - ProductExport 
Top level element tag - Product .
Attribute - alias Price as [@Price] .


Thanks,
Hema Chaudhry,
Delhi, India]]></description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>The correct answer is  Option 4</p>
<p>SELECT Price [@Price], ProductName AS [*]<br />
FROM CurrentProducts<br />
FOR XML PATH(‘Product’), ROOT(‘ProductExport’)</p>
<p>Explanation is -</p>
<p>As per the question the requirements are-</p>
<p>Root node name &#8211; ProductExport<br />
Top level element tag &#8211; Product .<br />
Attribute &#8211; alias Price as [@Price] .</p>
<p>Thanks,<br />
Hema Chaudhry,<br />
Delhi, India</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Varinder Sandhu</title>
		<link>http://blog.sqlauthority.com/2011/09/01/sql-server-tips-from-the-sql-joes-2-pros-development-series-using-root-with-auto-xml-mode-day-32-of-35/#comment-164358</link>
		<dc:creator><![CDATA[Varinder Sandhu]]></dc:creator>
		<pubDate>Thu, 01 Sep 2011 16:03:06 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=14135#comment-164358</guid>
		<description><![CDATA[Correct answer is option 4 as 

SELECT Price [@Price], ProductName AS [*]
FROM CurrentProducts
FOR XML PATH(‘Product’), ROOT(‘ProductExport’)

Varinder Sandhu (India)]]></description>
		<content:encoded><![CDATA[<p>Correct answer is option 4 as </p>
<p>SELECT Price [@Price], ProductName AS [*]<br />
FROM CurrentProducts<br />
FOR XML PATH(‘Product’), ROOT(‘ProductExport’)</p>
<p>Varinder Sandhu (India)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nikhil Mahajan</title>
		<link>http://blog.sqlauthority.com/2011/09/01/sql-server-tips-from-the-sql-joes-2-pros-development-series-using-root-with-auto-xml-mode-day-32-of-35/#comment-164347</link>
		<dc:creator><![CDATA[Nikhil Mahajan]]></dc:creator>
		<pubDate>Thu, 01 Sep 2011 15:18:11 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=14135#comment-164347</guid>
		<description><![CDATA[the correct answer is option no 4 i.e.

4. SELECT Price [@Price], ProductName AS [*]
FROM CurrentProducts
FOR XML PATH(‘Product’), ROOT(‘ProductExport’)

which will give you desired output...

India]]></description>
		<content:encoded><![CDATA[<p>the correct answer is option no 4 i.e.</p>
<p>4. SELECT Price [@Price], ProductName AS [*]<br />
FROM CurrentProducts<br />
FOR XML PATH(‘Product’), ROOT(‘ProductExport’)</p>
<p>which will give you desired output&#8230;</p>
<p>India</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dipti</title>
		<link>http://blog.sqlauthority.com/2011/09/01/sql-server-tips-from-the-sql-joes-2-pros-development-series-using-root-with-auto-xml-mode-day-32-of-35/#comment-164336</link>
		<dc:creator><![CDATA[Dipti]]></dc:creator>
		<pubDate>Thu, 01 Sep 2011 14:39:21 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=14135#comment-164336</guid>
		<description><![CDATA[Option 4 is correct
India]]></description>
		<content:encoded><![CDATA[<p>Option 4 is correct<br />
India</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kevin Scharnhorst</title>
		<link>http://blog.sqlauthority.com/2011/09/01/sql-server-tips-from-the-sql-joes-2-pros-development-series-using-root-with-auto-xml-mode-day-32-of-35/#comment-164332</link>
		<dc:creator><![CDATA[Kevin Scharnhorst]]></dc:creator>
		<pubDate>Thu, 01 Sep 2011 14:19:04 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=14135#comment-164332</guid>
		<description><![CDATA[4.SELECT Price [@Price], ProductName AS [*]
FROM CurrentProducts
FOR XML PATH(‘Product’), ROOT(‘ProductExport’)

Kevin Scharnhorst
United States]]></description>
		<content:encoded><![CDATA[<p>4.SELECT Price [@Price], ProductName AS [*]<br />
FROM CurrentProducts<br />
FOR XML PATH(‘Product’), ROOT(‘ProductExport’)</p>
<p>Kevin Scharnhorst<br />
United States</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dufagundes</title>
		<link>http://blog.sqlauthority.com/2011/09/01/sql-server-tips-from-the-sql-joes-2-pros-development-series-using-root-with-auto-xml-mode-day-32-of-35/#comment-164328</link>
		<dc:creator><![CDATA[dufagundes]]></dc:creator>
		<pubDate>Thu, 01 Sep 2011 14:03:40 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=14135#comment-164328</guid>
		<description><![CDATA[The correction is Option 4

Country of Residence:BRL]]></description>
		<content:encoded><![CDATA[<p>The correction is Option 4</p>
<p>Country of Residence:BRL</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David Seefeld</title>
		<link>http://blog.sqlauthority.com/2011/09/01/sql-server-tips-from-the-sql-joes-2-pros-development-series-using-root-with-auto-xml-mode-day-32-of-35/#comment-164314</link>
		<dc:creator><![CDATA[David Seefeld]]></dc:creator>
		<pubDate>Thu, 01 Sep 2011 13:29:33 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=14135#comment-164314</guid>
		<description><![CDATA[The correction is Option 4

SELECT Price [@Price], ProductName AS [*]
FROM CurrentProducts
FOR XML PATH(‘Product’), ROOT(‘ProductExport’)

Option 1 and 3 don&#039;t state ROOT(‘ProductExport’)
Option 2 doesn&#039;t declare the custom attribute Price

Country of Residence:USA]]></description>
		<content:encoded><![CDATA[<p>The correction is Option 4</p>
<p>SELECT Price [@Price], ProductName AS [*]<br />
FROM CurrentProducts<br />
FOR XML PATH(‘Product’), ROOT(‘ProductExport’)</p>
<p>Option 1 and 3 don&#8217;t state ROOT(‘ProductExport’)<br />
Option 2 doesn&#8217;t declare the custom attribute Price</p>
<p>Country of Residence:USA</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ron A. Farris</title>
		<link>http://blog.sqlauthority.com/2011/09/01/sql-server-tips-from-the-sql-joes-2-pros-development-series-using-root-with-auto-xml-mode-day-32-of-35/#comment-164309</link>
		<dc:creator><![CDATA[Ron A. Farris]]></dc:creator>
		<pubDate>Thu, 01 Sep 2011 13:11:09 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=14135#comment-164309</guid>
		<description><![CDATA[correct Answer is: 
4. SELECT Price [@Price], ProductName AS [*]
    FROM CurrentProducts
    FOR XML PATH(&#039;Product&#039;), ROOT(&#039;ProductExport&#039;)
Because we want to show both attributes and elements we will use XML PATH,
change the ROOT Node for opening and closing tags to ProductsExport. Include the @ price to add to the Products tag. 

Ron A. Farris - USA]]></description>
		<content:encoded><![CDATA[<p>correct Answer is:<br />
4. SELECT Price [@Price], ProductName AS [*]<br />
    FROM CurrentProducts<br />
    FOR XML PATH(&#8216;Product&#8217;), ROOT(&#8216;ProductExport&#8217;)<br />
Because we want to show both attributes and elements we will use XML PATH,<br />
change the ROOT Node for opening and closing tags to ProductsExport. Include the @ price to add to the Products tag. </p>
<p>Ron A. Farris &#8211; USA</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bill Pepping</title>
		<link>http://blog.sqlauthority.com/2011/09/01/sql-server-tips-from-the-sql-joes-2-pros-development-series-using-root-with-auto-xml-mode-day-32-of-35/#comment-164306</link>
		<dc:creator><![CDATA[Bill Pepping]]></dc:creator>
		<pubDate>Thu, 01 Sep 2011 12:58:14 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=14135#comment-164306</guid>
		<description><![CDATA[Hi Pinal,
 
Challenge:
Question 32
You need to generate the following XML document from your CurrentProducts table:


Product1
Product2
Product3
Product4


Which query should you use?

1.	SELECT Price, ProductName
FROM CurrentProducts AS ProductExport
FOR XML PATH(‘Product’)

2.	SELECT Price, ProductName
FROM CurrentProducts
FOR XML AUTO, ROOT(‘ProductExport’)

3.	SELECT Price [@Price], ProductName AS [*]
FROM CurrentProducts AS ProductExport
FOR XML AUTO, ELEMENTS

4.	SELECT Price [@Price], ProductName AS [*]
FROM CurrentProducts
FOR XML PATH(‘Product’), ROOT(‘ProductExport’)


Correct Answer:
The correct choice is #4: 
4.	SELECT Price [@Price], ProductName AS [*]
FROM CurrentProducts
FOR XML PATH(‘Product’), ROOT(‘ProductExport’)


Explanation:
Choice #1 is aliasing the table CurrentProductas as ProductExport. This won&#039;t give a result stream with a root node of ProductExport.  This choice is incorrect.

Choice #2 provides a root node of ProductExport, but doesn&#039;t provide the Product tag.  This choice is incorrect.

Choice #3 doesn&#039;t provide a root node.  This choice is incorrect.

Choice #4 provides the output that was requested.  This is the correct choice.


Country:
United States
 
Thanks for the knowledge!
 
Regards,
 
Bill Pepping]]></description>
		<content:encoded><![CDATA[<p>Hi Pinal,</p>
<p>Challenge:<br />
Question 32<br />
You need to generate the following XML document from your CurrentProducts table:</p>
<p>Product1<br />
Product2<br />
Product3<br />
Product4</p>
<p>Which query should you use?</p>
<p>1.	SELECT Price, ProductName<br />
FROM CurrentProducts AS ProductExport<br />
FOR XML PATH(‘Product’)</p>
<p>2.	SELECT Price, ProductName<br />
FROM CurrentProducts<br />
FOR XML AUTO, ROOT(‘ProductExport’)</p>
<p>3.	SELECT Price [@Price], ProductName AS [*]<br />
FROM CurrentProducts AS ProductExport<br />
FOR XML AUTO, ELEMENTS</p>
<p>4.	SELECT Price [@Price], ProductName AS [*]<br />
FROM CurrentProducts<br />
FOR XML PATH(‘Product’), ROOT(‘ProductExport’)</p>
<p>Correct Answer:<br />
The correct choice is #4:<br />
4.	SELECT Price [@Price], ProductName AS [*]<br />
FROM CurrentProducts<br />
FOR XML PATH(‘Product’), ROOT(‘ProductExport’)</p>
<p>Explanation:<br />
Choice #1 is aliasing the table CurrentProductas as ProductExport. This won&#8217;t give a result stream with a root node of ProductExport.  This choice is incorrect.</p>
<p>Choice #2 provides a root node of ProductExport, but doesn&#8217;t provide the Product tag.  This choice is incorrect.</p>
<p>Choice #3 doesn&#8217;t provide a root node.  This choice is incorrect.</p>
<p>Choice #4 provides the output that was requested.  This is the correct choice.</p>
<p>Country:<br />
United States</p>
<p>Thanks for the knowledge!</p>
<p>Regards,</p>
<p>Bill Pepping</p>
]]></content:encoded>
	</item>
</channel>
</rss>
