<?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; Explanation and Comparison of NULLIF and ISNULL</title>
	<atom:link href="http://blog.sqlauthority.com/2007/06/22/sql-server-explanation-and-comparison-of-nullif-and-isnull/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.sqlauthority.com/2007/06/22/sql-server-explanation-and-comparison-of-nullif-and-isnull/</link>
	<description>Personal Notes of Pinal Dave</description>
	<lastBuildDate>Sun, 12 Feb 2012 09:22:39 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: Ravindra T C</title>
		<link>http://blog.sqlauthority.com/2007/06/22/sql-server-explanation-and-comparison-of-nullif-and-isnull/#comment-239301</link>
		<dc:creator><![CDATA[Ravindra T C]]></dc:creator>
		<pubDate>Tue, 17 Jan 2012 11:01:10 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/06/22/sql-server-explanation-and-comparison-of-nullif-and-isnull/#comment-239301</guid>
		<description><![CDATA[Hi Sir, what is dynamic query? why we need dynamic query?]]></description>
		<content:encoded><![CDATA[<p>Hi Sir, what is dynamic query? why we need dynamic query?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sunaina Jain</title>
		<link>http://blog.sqlauthority.com/2007/06/22/sql-server-explanation-and-comparison-of-nullif-and-isnull/#comment-159755</link>
		<dc:creator><![CDATA[Sunaina Jain]]></dc:creator>
		<pubDate>Sat, 20 Aug 2011 05:45:31 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/06/22/sql-server-explanation-and-comparison-of-nullif-and-isnull/#comment-159755</guid>
		<description><![CDATA[Thanks alot sir]]></description>
		<content:encoded><![CDATA[<p>Thanks alot sir</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: madhivanan</title>
		<link>http://blog.sqlauthority.com/2007/06/22/sql-server-explanation-and-comparison-of-nullif-and-isnull/#comment-153120</link>
		<dc:creator><![CDATA[madhivanan]]></dc:creator>
		<pubDate>Wed, 03 Aug 2011 11:05:50 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/06/22/sql-server-explanation-and-comparison-of-nullif-and-isnull/#comment-153120</guid>
		<description><![CDATA[It will show you divide by 0 error which is expectable. What do you want to return instead of error?]]></description>
		<content:encoded><![CDATA[<p>It will show you divide by 0 error which is expectable. What do you want to return instead of error?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Preet Sahni</title>
		<link>http://blog.sqlauthority.com/2007/06/22/sql-server-explanation-and-comparison-of-nullif-and-isnull/#comment-153103</link>
		<dc:creator><![CDATA[Preet Sahni]]></dc:creator>
		<pubDate>Wed, 03 Aug 2011 10:21:26 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/06/22/sql-server-explanation-and-comparison-of-nullif-and-isnull/#comment-153103</guid>
		<description><![CDATA[select 1/0
 its shows error ….
 plz help me???]]></description>
		<content:encoded><![CDATA[<p>select 1/0<br />
 its shows error ….<br />
 plz help me???</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Preet Sahni</title>
		<link>http://blog.sqlauthority.com/2007/06/22/sql-server-explanation-and-comparison-of-nullif-and-isnull/#comment-153099</link>
		<dc:creator><![CDATA[Preet Sahni]]></dc:creator>
		<pubDate>Wed, 03 Aug 2011 10:17:36 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/06/22/sql-server-explanation-and-comparison-of-nullif-and-isnull/#comment-153099</guid>
		<description><![CDATA[select 1/0 
its shows error ....
plz help  me???]]></description>
		<content:encoded><![CDATA[<p>select 1/0<br />
its shows error &#8230;.<br />
plz help  me???</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Uday Satardekar</title>
		<link>http://blog.sqlauthority.com/2007/06/22/sql-server-explanation-and-comparison-of-nullif-and-isnull/#comment-140171</link>
		<dc:creator><![CDATA[Uday Satardekar]]></dc:creator>
		<pubDate>Fri, 10 Jun 2011 05:44:58 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/06/22/sql-server-explanation-and-comparison-of-nullif-and-isnull/#comment-140171</guid>
		<description><![CDATA[hello i am uday satardekar from ghotgewadi ,dodamarg.
and  i  select email from table but if depends on 4 combo box.if one null then omitt it.how?]]></description>
		<content:encoded><![CDATA[<p>hello i am uday satardekar from ghotgewadi ,dodamarg.<br />
and  i  select email from table but if depends on 4 combo box.if one null then omitt it.how?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pree</title>
		<link>http://blog.sqlauthority.com/2007/06/22/sql-server-explanation-and-comparison-of-nullif-and-isnull/#comment-108462</link>
		<dc:creator><![CDATA[Pree]]></dc:creator>
		<pubDate>Wed, 29 Dec 2010 07:05:58 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/06/22/sql-server-explanation-and-comparison-of-nullif-and-isnull/#comment-108462</guid>
		<description><![CDATA[hi..
Thxs for the help.. which i got from ur website..]]></description>
		<content:encoded><![CDATA[<p>hi..<br />
Thxs for the help.. which i got from ur website..</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Scott</title>
		<link>http://blog.sqlauthority.com/2007/06/22/sql-server-explanation-and-comparison-of-nullif-and-isnull/#comment-101890</link>
		<dc:creator><![CDATA[Scott]]></dc:creator>
		<pubDate>Wed, 24 Nov 2010 16:01:59 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/06/22/sql-server-explanation-and-comparison-of-nullif-and-isnull/#comment-101890</guid>
		<description><![CDATA[They should be called NULLIF and IFNULL to show they are truly opposites.]]></description>
		<content:encoded><![CDATA[<p>They should be called NULLIF and IFNULL to show they are truly opposites.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Saurabh</title>
		<link>http://blog.sqlauthority.com/2007/06/22/sql-server-explanation-and-comparison-of-nullif-and-isnull/#comment-61459</link>
		<dc:creator><![CDATA[Saurabh]]></dc:creator>
		<pubDate>Fri, 19 Feb 2010 07:15:51 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/06/22/sql-server-explanation-and-comparison-of-nullif-and-isnull/#comment-61459</guid>
		<description><![CDATA[good one]]></description>
		<content:encoded><![CDATA[<p>good one</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: GB</title>
		<link>http://blog.sqlauthority.com/2007/06/22/sql-server-explanation-and-comparison-of-nullif-and-isnull/#comment-58207</link>
		<dc:creator><![CDATA[GB]]></dc:creator>
		<pubDate>Fri, 04 Dec 2009 20:03:23 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/06/22/sql-server-explanation-and-comparison-of-nullif-and-isnull/#comment-58207</guid>
		<description><![CDATA[We got huge performance issue whenever we use NULLIF instead of IsNull() in Where clause

Example:

NullIf(column,&#039;&#039;) is not null

So we replaced

isNull(column,&#039;&#039;)  &#039;&#039;

I don&#039;t understand the problem.]]></description>
		<content:encoded><![CDATA[<p>We got huge performance issue whenever we use NULLIF instead of IsNull() in Where clause</p>
<p>Example:</p>
<p>NullIf(column,&#8221;) is not null</p>
<p>So we replaced</p>
<p>isNull(column,&#8221;)  &#8221;</p>
<p>I don&#8217;t understand the problem.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mattmc3</title>
		<link>http://blog.sqlauthority.com/2007/06/22/sql-server-explanation-and-comparison-of-nullif-and-isnull/#comment-50733</link>
		<dc:creator><![CDATA[mattmc3]]></dc:creator>
		<pubDate>Thu, 09 Apr 2009 20:26:30 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/06/22/sql-server-explanation-and-comparison-of-nullif-and-isnull/#comment-50733</guid>
		<description><![CDATA[Now, here&#039;s a fun one... if you don&#039;t want to set ansi_nulls, you can use the isnull()/nullif() combo when comparing two values in a table.

The trick is in this line: isnull(nullif(val1, val2), nullif(val2, val1)) is null

--------------------------------------
--------------------------------------
if object_id(&#039;tempdb..#test&#039;) is not null drop table #test
create table #test (
	val1 varchar(50),
	val2 varchar(50)
)

insert into #test
select &#039;Bill&#039;, &#039;Bill&#039;
union all
select null, null
union all
select &#039;Bill&#039;, null
union all
select &#039;Bill&#039;, &#039;Gates&#039;
union all
select null, &#039;Gates&#039;

select
	val1,
	val2,
	case
		when val1 = val2 then &#039;(wrong) equal&#039;
		else &#039;&#039;
	end as WrongEquals,
	case
		when (val1  val2) then &#039;(wrong) NOT equal&#039;
		else &#039;&#039;
	end as WrongNotEquals,
	NULLIF(val1, val2) as NullIf1_2,
	NULLIF(val2, val1) as NullIf2_1,
	case
		when isnull(nullif(val1, val2), nullif(val2, val1)) is null then &#039;eqivalent!&#039;
		else &#039;&#039;
	end as OddlyCorrect_Equivalent,
	case
		when isnull(nullif(val1, val2), nullif(val2, val1)) is not null then &#039;NOT eqivalent!&#039;
		else &#039;&#039;
	end as OddlyCorrect_NotEquivalent
from
	#test
--------------------------------------
--------------------------------------

Enjoy wrapping your mind around that.]]></description>
		<content:encoded><![CDATA[<p>Now, here&#8217;s a fun one&#8230; if you don&#8217;t want to set ansi_nulls, you can use the isnull()/nullif() combo when comparing two values in a table.</p>
<p>The trick is in this line: isnull(nullif(val1, val2), nullif(val2, val1)) is null</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
if object_id(&#8216;tempdb..#test&#8217;) is not null drop table #test<br />
create table #test (<br />
	val1 varchar(50),<br />
	val2 varchar(50)<br />
)</p>
<p>insert into #test<br />
select &#8216;Bill&#8217;, &#8216;Bill&#8217;<br />
union all<br />
select null, null<br />
union all<br />
select &#8216;Bill&#8217;, null<br />
union all<br />
select &#8216;Bill&#8217;, &#8216;Gates&#8217;<br />
union all<br />
select null, &#8216;Gates&#8217;</p>
<p>select<br />
	val1,<br />
	val2,<br />
	case<br />
		when val1 = val2 then &#8216;(wrong) equal&#8217;<br />
		else &#8221;<br />
	end as WrongEquals,<br />
	case<br />
		when (val1  val2) then &#8216;(wrong) NOT equal&#8217;<br />
		else &#8221;<br />
	end as WrongNotEquals,<br />
	NULLIF(val1, val2) as NullIf1_2,<br />
	NULLIF(val2, val1) as NullIf2_1,<br />
	case<br />
		when isnull(nullif(val1, val2), nullif(val2, val1)) is null then &#8216;eqivalent!&#8217;<br />
		else &#8221;<br />
	end as OddlyCorrect_Equivalent,<br />
	case<br />
		when isnull(nullif(val1, val2), nullif(val2, val1)) is not null then &#8216;NOT eqivalent!&#8217;<br />
		else &#8221;<br />
	end as OddlyCorrect_NotEquivalent<br />
from<br />
	#test<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>Enjoy wrapping your mind around that.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SQLAuthority News - Best Articles on SQLAuthority.com Journey to SQL Authority with Pinal Dave</title>
		<link>http://blog.sqlauthority.com/2007/06/22/sql-server-explanation-and-comparison-of-nullif-and-isnull/#comment-47223</link>
		<dc:creator><![CDATA[SQLAuthority News - Best Articles on SQLAuthority.com Journey to SQL Authority with Pinal Dave]]></dc:creator>
		<pubDate>Tue, 24 Feb 2009 12:09:20 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/06/22/sql-server-explanation-and-comparison-of-nullif-and-isnull/#comment-47223</guid>
		<description><![CDATA[[...] SQL SERVER - Explanation and Comparison of NULLIF and ISNULL [...]]]></description>
		<content:encoded><![CDATA[<p>[...] SQL SERVER &#8211; Explanation and Comparison of NULLIF and ISNULL [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Neal Patel</title>
		<link>http://blog.sqlauthority.com/2007/06/22/sql-server-explanation-and-comparison-of-nullif-and-isnull/#comment-37322</link>
		<dc:creator><![CDATA[Neal Patel]]></dc:creator>
		<pubDate>Thu, 08 May 2008 17:42:21 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/06/22/sql-server-explanation-and-comparison-of-nullif-and-isnull/#comment-37322</guid>
		<description><![CDATA[I have a serious of bit values.  I want to display column if bit value is 1 and hide column if bit value is 0.  How can I achieve this.  Here is what I have so far.

ALTER         PROCEDURE [dbo].[sp_datadump_selectfromcheckbox] 
	@project_ID	int,
 	@Title_isChecked bit 
	
	
	

AS
BEGIN 
SELECT  PRSDATA.Anomaly_ID,

CASE WHEN @Title_isChecked =&#039;1&#039; THEN (Select PRSDATA.Title) END &#039;  &#039;


	

	from PRSDATA,PRSDATA1, PRSDATA2, PRSDATA3, PRSDATA4,  PRSDATA5, PRSDATA6, PRSDATA7 , PRSDATA8 
	WHERE PRSDATA.anomaly_id = PRSDATA1.anomaly_id and 
	PRSDATA.anomaly_id = PRSDATA2.anomaly_id and 
	PRSDATA.anomaly_id = PRSDATA3.anomaly_id and 
	PRSDATA.anomaly_id = PRSDATA4.anomaly_id and 
	PRSDATA.anomaly_id = PRSDATA5.anomaly_id and 
	PRSDATA.anomaly_id = PRSDATA6.anomaly_id and 
	PRSDATA.anomaly_id = PRSDATA7.anomaly_id and 
	PRSDATA.anomaly_id = PRSDATA8.anomaly_id and 
	PRSDATA.Main_Project_Affected =   @project_ID
  
  
	
END	
	if (@@error = 0)
		begin
			RETURN 0
		end
	else
		begin
			RETURN 1
		end]]></description>
		<content:encoded><![CDATA[<p>I have a serious of bit values.  I want to display column if bit value is 1 and hide column if bit value is 0.  How can I achieve this.  Here is what I have so far.</p>
<p>ALTER         PROCEDURE [dbo].[sp_datadump_selectfromcheckbox]<br />
	@project_ID	int,<br />
 	@Title_isChecked bit </p>
<p>AS<br />
BEGIN<br />
SELECT  PRSDATA.Anomaly_ID,</p>
<p>CASE WHEN @Title_isChecked =&#8217;1&#8242; THEN (Select PRSDATA.Title) END &#8216;  &#8216;</p>
<p>	from PRSDATA,PRSDATA1, PRSDATA2, PRSDATA3, PRSDATA4,  PRSDATA5, PRSDATA6, PRSDATA7 , PRSDATA8<br />
	WHERE PRSDATA.anomaly_id = PRSDATA1.anomaly_id and<br />
	PRSDATA.anomaly_id = PRSDATA2.anomaly_id and<br />
	PRSDATA.anomaly_id = PRSDATA3.anomaly_id and<br />
	PRSDATA.anomaly_id = PRSDATA4.anomaly_id and<br />
	PRSDATA.anomaly_id = PRSDATA5.anomaly_id and<br />
	PRSDATA.anomaly_id = PRSDATA6.anomaly_id and<br />
	PRSDATA.anomaly_id = PRSDATA7.anomaly_id and<br />
	PRSDATA.anomaly_id = PRSDATA8.anomaly_id and<br />
	PRSDATA.Main_Project_Affected =   @project_ID</p>
<p>END<br />
	if (@@error = 0)<br />
		begin<br />
			RETURN 0<br />
		end<br />
	else<br />
		begin<br />
			RETURN 1<br />
		end</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Aris Routis</title>
		<link>http://blog.sqlauthority.com/2007/06/22/sql-server-explanation-and-comparison-of-nullif-and-isnull/#comment-16990</link>
		<dc:creator><![CDATA[Aris Routis]]></dc:creator>
		<pubDate>Thu, 01 Nov 2007 11:48:06 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/06/22/sql-server-explanation-and-comparison-of-nullif-and-isnull/#comment-16990</guid>
		<description><![CDATA[declare @Test tinyint
set @Test = NULL
/*
Change to
set @Test = 0 or
set @Test = 1
keeping every other SET line remarked to check different
behaviours.
*/

select Case IsNull(@Test, 2) —
when 2 Then ‘IS NULL’
else ‘NOT NULL’
End Result

That should do it.]]></description>
		<content:encoded><![CDATA[<p>declare @Test tinyint<br />
set @Test = NULL<br />
/*<br />
Change to<br />
set @Test = 0 or<br />
set @Test = 1<br />
keeping every other SET line remarked to check different<br />
behaviours.<br />
*/</p>
<p>select Case IsNull(@Test, 2) —<br />
when 2 Then ‘IS NULL’<br />
else ‘NOT NULL’<br />
End Result</p>
<p>That should do it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Aris Routis</title>
		<link>http://blog.sqlauthority.com/2007/06/22/sql-server-explanation-and-comparison-of-nullif-and-isnull/#comment-16988</link>
		<dc:creator><![CDATA[Aris Routis]]></dc:creator>
		<pubDate>Thu, 01 Nov 2007 11:44:29 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/06/22/sql-server-explanation-and-comparison-of-nullif-and-isnull/#comment-16988</guid>
		<description><![CDATA[Yasar,
You should rephrase this to something like this 

declare @Test bit
set @Test = NULL
/*
Change to 
set @Test = 0 or
set @Test = 1
keeping every other SET line remarked to check different
behaviours.
*/

select Case IsNull(@Test, 0) -- 
	when 0 Then &#039;IS NULL&#039;
	else &#039;NOT NULL&#039;
End Result

That will work just fine.]]></description>
		<content:encoded><![CDATA[<p>Yasar,<br />
You should rephrase this to something like this </p>
<p>declare @Test bit<br />
set @Test = NULL<br />
/*<br />
Change to<br />
set @Test = 0 or<br />
set @Test = 1<br />
keeping every other SET line remarked to check different<br />
behaviours.<br />
*/</p>
<p>select Case IsNull(@Test, 0) &#8212;<br />
	when 0 Then &#8216;IS NULL&#8217;<br />
	else &#8216;NOT NULL&#8217;<br />
End Result</p>
<p>That will work just fine.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Yasar</title>
		<link>http://blog.sqlauthority.com/2007/06/22/sql-server-explanation-and-comparison-of-nullif-and-isnull/#comment-12808</link>
		<dc:creator><![CDATA[Yasar]]></dc:creator>
		<pubDate>Sun, 16 Sep 2007 16:33:39 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/06/22/sql-server-explanation-and-comparison-of-nullif-and-isnull/#comment-12808</guid>
		<description><![CDATA[I have the following code that uses the IsNull function.


declare @Test bit;
set @Test = &#039;false&#039;;

select (	Case When IsNull(@Test, &#039;&#039;) = &#039;&#039;
			Then &#039;IS NULL&#039; 
			Else &#039;NOT NULL&#039;
			End);

I would expect &#039;NOT NULL&#039; to be returned as @Test is set to a value &#039;false&#039;. However &#039;IS NULL&#039; is output instead.

Does SQL Server treat NULL the same as &#039;false&#039;?]]></description>
		<content:encoded><![CDATA[<p>I have the following code that uses the IsNull function.</p>
<p>declare @Test bit;<br />
set @Test = &#8216;false&#8217;;</p>
<p>select (	Case When IsNull(@Test, &#8221;) = &#8221;<br />
			Then &#8216;IS NULL&#8217;<br />
			Else &#8216;NOT NULL&#8217;<br />
			End);</p>
<p>I would expect &#8216;NOT NULL&#8217; to be returned as @Test is set to a value &#8216;false&#8217;. However &#8216;IS NULL&#8217; is output instead.</p>
<p>Does SQL Server treat NULL the same as &#8216;false&#8217;?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: pinaldave</title>
		<link>http://blog.sqlauthority.com/2007/06/22/sql-server-explanation-and-comparison-of-nullif-and-isnull/#comment-3913</link>
		<dc:creator><![CDATA[pinaldave]]></dc:creator>
		<pubDate>Fri, 22 Jun 2007 21:21:51 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/06/22/sql-server-explanation-and-comparison-of-nullif-and-isnull/#comment-3913</guid>
		<description><![CDATA[Hello The Waterproof SQL Champ good work,

I was expecting it to be done without using WHILE but I did not make that clear in question so it works.
Good Work. I modified your code to show how the infinite code can be generated. However following script will run till 10 iteration and will stop.

SET ANSI_NULLS OFF

DECLARE @test AS INT
SET @test = 1

WHILE ISNULL( NULLIF(@test, @test), @test ) = @test
BEGIN
PRINT &#039;HI&#039;
SET @test = @test + 1
IF @test &gt; 10
BREAK
END
GO

Warning : Do not run this code on production machine. Make sure you test it. The reason it is published here, so user who have similar problem can prevent infinite loop from happening.]]></description>
		<content:encoded><![CDATA[<p>Hello The Waterproof SQL Champ good work,</p>
<p>I was expecting it to be done without using WHILE but I did not make that clear in question so it works.<br />
Good Work. I modified your code to show how the infinite code can be generated. However following script will run till 10 iteration and will stop.</p>
<p>SET ANSI_NULLS OFF</p>
<p>DECLARE @test AS INT<br />
SET @test = 1</p>
<p>WHILE ISNULL( NULLIF(@test, @test), @test ) = @test<br />
BEGIN<br />
PRINT &#8216;HI&#8217;<br />
SET @test = @test + 1<br />
IF @test &gt; 10<br />
BREAK<br />
END<br />
GO</p>
<p>Warning : Do not run this code on production machine. Make sure you test it. The reason it is published here, so user who have similar problem can prevent infinite loop from happening.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: The Waterproof SQL Champ</title>
		<link>http://blog.sqlauthority.com/2007/06/22/sql-server-explanation-and-comparison-of-nullif-and-isnull/#comment-3912</link>
		<dc:creator><![CDATA[The Waterproof SQL Champ]]></dc:creator>
		<pubDate>Fri, 22 Jun 2007 21:07:30 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/06/22/sql-server-explanation-and-comparison-of-nullif-and-isnull/#comment-3912</guid>
		<description><![CDATA[SET ANSI_NULLS OFF

DECLARE @test AS INT
SET @test = 1

WHILE ISNULL( NULLIF(@test, @test), @test ) = @test
BEGIN
	PRINT &#039;HI&#039;
	BREAK
END

Making @test = NULL would still make it print &#039;HI&#039;]]></description>
		<content:encoded><![CDATA[<p>SET ANSI_NULLS OFF</p>
<p>DECLARE @test AS INT<br />
SET @test = 1</p>
<p>WHILE ISNULL( NULLIF(@test, @test), @test ) = @test<br />
BEGIN<br />
	PRINT &#8216;HI&#8217;<br />
	BREAK<br />
END</p>
<p>Making @test = NULL would still make it print &#8216;HI&#8217;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Angelos</title>
		<link>http://blog.sqlauthority.com/2007/06/22/sql-server-explanation-and-comparison-of-nullif-and-isnull/#comment-3910</link>
		<dc:creator><![CDATA[Angelos]]></dc:creator>
		<pubDate>Fri, 22 Jun 2007 16:39:25 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/06/22/sql-server-explanation-and-comparison-of-nullif-and-isnull/#comment-3910</guid>
		<description><![CDATA[Thanks, Nice tip

Maybe this ?

IsNull(null, nullif(1, 1)), but I guess it would just return null :P]]></description>
		<content:encoded><![CDATA[<p>Thanks, Nice tip</p>
<p>Maybe this ?</p>
<p>IsNull(null, nullif(1, 1)), but I guess it would just return null :P</p>
]]></content:encoded>
	</item>
</channel>
</rss>
