<?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 Use SQL Server XML Function exist()</title>
	<atom:link href="http://www.sqlmusings.com/2009/04/08/sqlxml-how-to-use-sql-server-xml-function-exist/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.sqlmusings.com/2009/04/08/sqlxml-how-to-use-sql-server-xml-function-exist/</link>
	<description>ramblings, discoveries, tutorials on sql server and other database stuff</description>
	<lastBuildDate>Wed, 25 Jan 2012 06:55:33 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: SQL Server Central</title>
		<link>http://www.sqlmusings.com/2009/04/08/sqlxml-how-to-use-sql-server-xml-function-exist/comment-page-1/#comment-5739</link>
		<dc:creator>SQL Server Central</dc:creator>
		<pubDate>Mon, 13 Dec 2010 05:42:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.sqlmusings.com/?p=617#comment-5739</guid>
		<description>[...] SQLXML : How to Use SQL Server XML Function exist() [...]</description>
		<content:encoded><![CDATA[<p>[...] SQLXML : How to Use SQL Server XML Function exist() [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: belle</title>
		<link>http://www.sqlmusings.com/2009/04/08/sqlxml-how-to-use-sql-server-xml-function-exist/comment-page-1/#comment-5723</link>
		<dc:creator>belle</dc:creator>
		<pubDate>Wed, 24 Nov 2010 16:56:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.sqlmusings.com/?p=617#comment-5723</guid>
		<description>yeah i did. unfortunately that doesn&#039;t work.</description>
		<content:encoded><![CDATA[<p>yeah i did. unfortunately that doesn&#8217;t work.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: XQuery for the Non-Expert &#8211; Resources &#124; Strate SQL</title>
		<link>http://www.sqlmusings.com/2009/04/08/sqlxml-how-to-use-sql-server-xml-function-exist/comment-page-1/#comment-5722</link>
		<dc:creator>XQuery for the Non-Expert &#8211; Resources &#124; Strate SQL</dc:creator>
		<pubDate>Wed, 24 Nov 2010 11:06:14 +0000</pubDate>
		<guid isPermaLink="false">http://www.sqlmusings.com/?p=617#comment-5722</guid>
		<description>[...] SQLXML : How to Use SQL Server XML Function exist() [...]</description>
		<content:encoded><![CDATA[<p>[...] SQLXML : How to Use SQL Server XML Function exist() [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: krishnaroopa</title>
		<link>http://www.sqlmusings.com/2009/04/08/sqlxml-how-to-use-sql-server-xml-function-exist/comment-page-1/#comment-5721</link>
		<dc:creator>krishnaroopa</dc:creator>
		<pubDate>Tue, 23 Nov 2010 10:43:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.sqlmusings.com/?p=617#comment-5721</guid>
		<description>Good Sample. In the select statement, 
SELECT @xml.exist(&#039;/ninjaElement[@id=sql:variable(&quot;@id&quot;)]&#039;)

can I give the condition itself in a variable? Have you tried out?</description>
		<content:encoded><![CDATA[<p>Good Sample. In the select statement,<br />
SELECT @xml.exist(&#8216;/ninjaElement[@id=sql:variable("@id")]&#8216;)</p>
<p>can I give the condition itself in a variable? Have you tried out?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ben</title>
		<link>http://www.sqlmusings.com/2009/04/08/sqlxml-how-to-use-sql-server-xml-function-exist/comment-page-1/#comment-5602</link>
		<dc:creator>Ben</dc:creator>
		<pubDate>Fri, 16 Jul 2010 21:07:47 +0000</pubDate>
		<guid isPermaLink="false">http://www.sqlmusings.com/?p=617#comment-5602</guid>
		<description>Oh, whoa, this saved me from a few gray hairs. I was trying to get the value of an XML element that existed in some columns, but not all, and adding it with similar elements in the same column (quantity1, quantity2, etc). In some instances, quantity1 didn&#039;t exist, yet quantity2 or quantity3 would, but the whole addition statement would be null. Now I check if the element exists; if it doesn&#039;t, the case statement returns 0; otherwise, it returns the value of the element.

Thank you!</description>
		<content:encoded><![CDATA[<p>Oh, whoa, this saved me from a few gray hairs. I was trying to get the value of an XML element that existed in some columns, but not all, and adding it with similar elements in the same column (quantity1, quantity2, etc). In some instances, quantity1 didn&#8217;t exist, yet quantity2 or quantity3 would, but the whole addition statement would be null. Now I check if the element exists; if it doesn&#8217;t, the case statement returns 0; otherwise, it returns the value of the element.</p>
<p>Thank you!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andrew</title>
		<link>http://www.sqlmusings.com/2009/04/08/sqlxml-how-to-use-sql-server-xml-function-exist/comment-page-1/#comment-1445</link>
		<dc:creator>Andrew</dc:creator>
		<pubDate>Fri, 17 Jul 2009 02:43:28 +0000</pubDate>
		<guid isPermaLink="false">http://www.sqlmusings.com/?p=617#comment-1445</guid>
		<description>Found a small problem ... you declare:

&lt;code&gt;
DECLARE @xmlSnippet XML 
&lt;/code&gt;

And then assign:

&lt;code&gt;
SET @xmlSnippet = 
&lt;/code&gt;

But in the queries you refer to @xml, which doesn&#039;t exist:

&lt;code&gt;
SELECT @xml.exist(&#039;//ninjaElement&#039;) 
&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>Found a small problem &#8230; you declare:</p>
<p><code><br />
DECLARE @xmlSnippet XML<br />
</code></p>
<p>And then assign:</p>
<p><code><br />
SET @xmlSnippet =<br />
</code></p>
<p>But in the queries you refer to @xml, which doesn&#8217;t exist:</p>
<p><code><br />
SELECT @xml.exist('//ninjaElement')<br />
</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Fred</title>
		<link>http://www.sqlmusings.com/2009/04/08/sqlxml-how-to-use-sql-server-xml-function-exist/comment-page-1/#comment-1260</link>
		<dc:creator>Fred</dc:creator>
		<pubDate>Wed, 24 Jun 2009 20:28:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.sqlmusings.com/?p=617#comment-1260</guid>
		<description>great post...saved me a lot of time!!!!</description>
		<content:encoded><![CDATA[<p>great post&#8230;saved me a lot of time!!!!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: timber trade marketplace</title>
		<link>http://www.sqlmusings.com/2009/04/08/sqlxml-how-to-use-sql-server-xml-function-exist/comment-page-1/#comment-169</link>
		<dc:creator>timber trade marketplace</dc:creator>
		<pubDate>Thu, 23 Apr 2009 14:28:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.sqlmusings.com/?p=617#comment-169</guid>
		<description>Hi, how can use xml in join clause? e.g. I have a xml variable and want to make something like this

table t1 
join @XML.nodes(&#039;/root/id&#039;) as ParamValues(ID) 
on t1.id=ParamValues.ID.value(&#039;.&#039;,&#039;int&#039;)

??</description>
		<content:encoded><![CDATA[<p>Hi, how can use xml in join clause? e.g. I have a xml variable and want to make something like this</p>
<p>table t1<br />
join @XML.nodes(&#8216;/root/id&#8217;) as ParamValues(ID)<br />
on t1.id=ParamValues.ID.value(&#8216;.&#8217;,'int&#8217;)</p>
<p>??</p>
]]></content:encoded>
	</item>
</channel>
</rss>

