<?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: SQL Server nastiness</title>
	<atom:link href="http://fugato.net/2005/02/08/sql-server-nastiness/feed/" rel="self" type="application/rss+xml" />
	<link>http://fugato.net/2005/02/08/sql-server-nastiness/</link>
	<description>Gunnlaugur Þór Briem</description>
	<lastBuildDate>Sun, 30 May 2010 18:46:11 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
	<item>
		<title>By: Jeremy</title>
		<link>http://fugato.net/2005/02/08/sql-server-nastiness/comment-page-1/#comment-34851</link>
		<dc:creator>Jeremy</dc:creator>
		<pubDate>Thu, 05 Feb 2009 20:41:13 +0000</pubDate>
		<guid isPermaLink="false">http://fugato.net/2005/02/08/sql-server-nastiness/#comment-34851</guid>
		<description>Wow, thanks for this article.  I had actually spent days pondering this issue until I finally found this helpful nugget of info.</description>
		<content:encoded><![CDATA[<p>Wow, thanks for this article.  I had actually spent days pondering this issue until I finally found this helpful nugget of info.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dan s.</title>
		<link>http://fugato.net/2005/02/08/sql-server-nastiness/comment-page-1/#comment-33479</link>
		<dc:creator>dan s.</dc:creator>
		<pubDate>Mon, 25 Feb 2008 12:43:51 +0000</pubDate>
		<guid isPermaLink="false">http://fugato.net/2005/02/08/sql-server-nastiness/#comment-33479</guid>
		<description>Thanks very much for the article, and a special thanks to Antonio for the nifty little function.

I was banging my head against the wall in SSIS trying to copy data from SQL2000 to SQL2005, with error messages like these:
Description: &quot;OLE DB provider &#039;STREAM&#039; for linked server &#039;(null)&#039; returned invalid data for column &#039;[!BulkInsert].column_name&#039;. &quot;. 

Turned out it was due to NaN being inserted by a third party. And SSIS did not like them.

Anyhoo... I modified Antonio&#039;s function to return Nulls instead NaN and used them on the offending columns. Works like a charm. So thanks again everybody</description>
		<content:encoded><![CDATA[<p>Thanks very much for the article, and a special thanks to Antonio for the nifty little function.</p>
<p>I was banging my head against the wall in SSIS trying to copy data from SQL2000 to SQL2005, with error messages like these:<br />
Description: &#8220;OLE DB provider &#8216;STREAM&#8217; for linked server &#8216;(null)&#8217; returned invalid data for column &#8216;[!BulkInsert].column_name&#8217;. &#8220;. </p>
<p>Turned out it was due to NaN being inserted by a third party. And SSIS did not like them.</p>
<p>Anyhoo&#8230; I modified Antonio&#8217;s function to return Nulls instead NaN and used them on the offending columns. Works like a charm. So thanks again everybody</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dan</title>
		<link>http://fugato.net/2005/02/08/sql-server-nastiness/comment-page-1/#comment-32935</link>
		<dc:creator>Dan</dc:creator>
		<pubDate>Mon, 17 Dec 2007 15:00:09 +0000</pubDate>
		<guid isPermaLink="false">http://fugato.net/2005/02/08/sql-server-nastiness/#comment-32935</guid>
		<description>Hi

Thanks for the Article !!!

In Our System it was Insereting Double.NaN into a float column that cause the problem

You can see the value &quot;NaN&quot; in SQL 2005 ,but not in SQL 2000!

Thanks again</description>
		<content:encoded><![CDATA[<p>Hi</p>
<p>Thanks for the Article !!!</p>
<p>In Our System it was Insereting Double.NaN into a float column that cause the problem</p>
<p>You can see the value &#8220;NaN&#8221; in SQL 2005 ,but not in SQL 2000!</p>
<p>Thanks again</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bfinley</title>
		<link>http://fugato.net/2005/02/08/sql-server-nastiness/comment-page-1/#comment-32667</link>
		<dc:creator>Bfinley</dc:creator>
		<pubDate>Mon, 05 Nov 2007 20:18:27 +0000</pubDate>
		<guid isPermaLink="false">http://fugato.net/2005/02/08/sql-server-nastiness/#comment-32667</guid>
		<description>Everyone, I ran into this error on one of my production databases and was able to successfully resolve the problem.  It was caused by index distribution statistics.  However, it was fairly difficult to identify at first since all the user would see is the error when the APP attempted to view data on the table.  

I ran a trace and narrowed down the affected tables.  Next, I ran dbcc show_statistics ‘table name’ and statement consistently failed on one table in particular.  I dropped the statistics from the table and recreated the stats using sp_autostats ‘table name’.  Afterwards, the error was corrected.  The article below led me in the correct direction.  It should be mentioned that I DID NOT install SP4 to resolve the problem.  

http://support.microsoft.com/kb/816503 

Hope this helps.</description>
		<content:encoded><![CDATA[<p>Everyone, I ran into this error on one of my production databases and was able to successfully resolve the problem.  It was caused by index distribution statistics.  However, it was fairly difficult to identify at first since all the user would see is the error when the APP attempted to view data on the table.  </p>
<p>I ran a trace and narrowed down the affected tables.  Next, I ran dbcc show_statistics ‘table name’ and statement consistently failed on one table in particular.  I dropped the statistics from the table and recreated the stats using sp_autostats ‘table name’.  Afterwards, the error was corrected.  The article below led me in the correct direction.  It should be mentioned that I DID NOT install SP4 to resolve the problem.  </p>
<p><a href="http://support.microsoft.com/kb/816503" rel="nofollow">http://support.microsoft.com/kb/816503</a> </p>
<p>Hope this helps.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: GC</title>
		<link>http://fugato.net/2005/02/08/sql-server-nastiness/comment-page-1/#comment-31913</link>
		<dc:creator>GC</dc:creator>
		<pubDate>Tue, 15 May 2007 13:53:33 +0000</pubDate>
		<guid isPermaLink="false">http://fugato.net/2005/02/08/sql-server-nastiness/#comment-31913</guid>
		<description>Thanks for the hint on creating a function.  It worked like a charm.</description>
		<content:encoded><![CDATA[<p>Thanks for the hint on creating a function.  It worked like a charm.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: GÞB</title>
		<link>http://fugato.net/2005/02/08/sql-server-nastiness/comment-page-1/#comment-25552</link>
		<dc:creator>GÞB</dc:creator>
		<pubDate>Mon, 05 Feb 2007 17:52:21 +0000</pubDate>
		<guid isPermaLink="false">http://fugato.net/2005/02/08/sql-server-nastiness/#comment-25552</guid>
		<description>Thanks for that ... is that just a conjecture, something you&#039;re suggesting I try out, or have you already successfully tested this as a workaround under the same circumstances?

I don&#039;t have a current test case to try this out on, and am disinclined to go creating one now if you can already confirm that this works. :)</description>
		<content:encoded><![CDATA[<p>Thanks for that &#8230; is that just a conjecture, something you&#8217;re suggesting I try out, or have you already successfully tested this as a workaround under the same circumstances?</p>
<p>I don&#8217;t have a current test case to try this out on, and am disinclined to go creating one now if you can already confirm that this works. :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Antonio</title>
		<link>http://fugato.net/2005/02/08/sql-server-nastiness/comment-page-1/#comment-25551</link>
		<dc:creator>Antonio</dc:creator>
		<pubDate>Mon, 05 Feb 2007 17:50:36 +0000</pubDate>
		<guid isPermaLink="false">http://fugato.net/2005/02/08/sql-server-nastiness/#comment-25551</guid>
		<description>Sorry! Typo.  IsNan is exactly the opposite, and it should take care of nulls... :

CREATE FUNCTION IsNaN
(
	@number float
)
RETURNS int
AS
BEGIN
	return case isnumeric(convert(varchar(100), coalesce(@number,0)))  when 1 then 0 else 1 end
END
GO</description>
		<content:encoded><![CDATA[<p>Sorry! Typo.  IsNan is exactly the opposite, and it should take care of nulls&#8230; :</p>
<p>CREATE FUNCTION IsNaN<br />
(<br />
	@number float<br />
)<br />
RETURNS int<br />
AS<br />
BEGIN<br />
	return case isnumeric(convert(varchar(100), coalesce(@number,0)))  when 1 then 0 else 1 end<br />
END<br />
GO</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Antonio</title>
		<link>http://fugato.net/2005/02/08/sql-server-nastiness/comment-page-1/#comment-25549</link>
		<dc:creator>Antonio</dc:creator>
		<pubDate>Mon, 05 Feb 2007 17:34:31 +0000</pubDate>
		<guid isPermaLink="false">http://fugato.net/2005/02/08/sql-server-nastiness/#comment-25549</guid>
		<description>Try this:


CREATE FUNCTION IsNaN
(
	@number float
)
RETURNS int
AS
BEGIN
	return isnumeric(convert(varchar(100), @number))
END
GO


and then ...

UPDATE tblName SET floatCol = @someOkValue where dbo.IsNan(floatCol) = 1</description>
		<content:encoded><![CDATA[<p>Try this:</p>
<p>CREATE FUNCTION IsNaN<br />
(<br />
	@number float<br />
)<br />
RETURNS int<br />
AS<br />
BEGIN<br />
	return isnumeric(convert(varchar(100), @number))<br />
END<br />
GO</p>
<p>and then &#8230;</p>
<p>UPDATE tblName SET floatCol = @someOkValue where dbo.IsNan(floatCol) = 1</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Søren Thulesen</title>
		<link>http://fugato.net/2005/02/08/sql-server-nastiness/comment-page-1/#comment-2539</link>
		<dc:creator>Søren Thulesen</dc:creator>
		<pubDate>Tue, 23 May 2006 12:53:23 +0000</pubDate>
		<guid isPermaLink="false">http://fugato.net/2005/02/08/sql-server-nastiness/#comment-2539</guid>
		<description>Thanx a bunch dude!
Ran into this weird error some days ago.. couldn&#039;t make head or tails of the weird &quot;-1,#IND&quot; value in Enterprise Manager.... now I have to go bughunting to see why it inserts Double.Nan..</description>
		<content:encoded><![CDATA[<p>Thanx a bunch dude!<br />
Ran into this weird error some days ago.. couldn&#8217;t make head or tails of the weird &#8220;-1,#IND&#8221; value in Enterprise Manager&#8230;. now I have to go bughunting to see why it inserts Double.Nan..</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: GÞB</title>
		<link>http://fugato.net/2005/02/08/sql-server-nastiness/comment-page-1/#comment-2506</link>
		<dc:creator>GÞB</dc:creator>
		<pubDate>Thu, 18 May 2006 13:43:56 +0000</pubDate>
		<guid isPermaLink="false">http://fugato.net/2005/02/08/sql-server-nastiness/#comment-2506</guid>
		<description>As I said, the only remedy I know of is

&lt;pre&gt;UPDATE tblName SET floatCol = @someOkValue WHERE id IN (x,y,z, ...)&lt;/pre&gt;

where you fill in the id list by hand, by eyeballing the bad rows in Enterprise Manager. If your table is very big, then I don&#039;t imagine you&#039;ll enjoy that much. But I don&#039;t know any automated way to match these broken values in a WHERE clause, sorry.</description>
		<content:encoded><![CDATA[<p>As I said, the only remedy I know of is</p>
<pre>UPDATE tblName SET floatCol = @someOkValue WHERE id IN (x,y,z, ...)</pre>
<p>where you fill in the id list by hand, by eyeballing the bad rows in Enterprise Manager. If your table is very big, then I don&#8217;t imagine you&#8217;ll enjoy that much. But I don&#8217;t know any automated way to match these broken values in a WHERE clause, sorry.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Drew Noakes</title>
		<link>http://fugato.net/2005/02/08/sql-server-nastiness/comment-page-1/#comment-2502</link>
		<dc:creator>Drew Noakes</dc:creator>
		<pubDate>Thu, 18 May 2006 11:14:06 +0000</pubDate>
		<guid isPermaLink="false">http://fugato.net/2005/02/08/sql-server-nastiness/#comment-2502</guid>
		<description>Thanks for this post.  Unfortunately, I&#039;m dealing with a database that has rows created with this error.  Can I do anything to recover from this?  Ideally I&#039;d like to delete the offending rows, and avoid having to drop/recreate the entire table.</description>
		<content:encoded><![CDATA[<p>Thanks for this post.  Unfortunately, I&#8217;m dealing with a database that has rows created with this error.  Can I do anything to recover from this?  Ideally I&#8217;d like to delete the offending rows, and avoid having to drop/recreate the entire table.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kam-Chuen Jim</title>
		<link>http://fugato.net/2005/02/08/sql-server-nastiness/comment-page-1/#comment-2215</link>
		<dc:creator>Kam-Chuen Jim</dc:creator>
		<pubDate>Wed, 01 Mar 2006 14:51:55 +0000</pubDate>
		<guid isPermaLink="false">http://fugato.net/2005/02/08/sql-server-nastiness/#comment-2215</guid>
		<description>This helped me - thanks so much!</description>
		<content:encoded><![CDATA[<p>This helped me &#8211; thanks so much!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dale Anderson</title>
		<link>http://fugato.net/2005/02/08/sql-server-nastiness/comment-page-1/#comment-1966</link>
		<dc:creator>Dale Anderson</dc:creator>
		<pubDate>Wed, 04 Jan 2006 02:56:12 +0000</pubDate>
		<guid isPermaLink="false">http://fugato.net/2005/02/08/sql-server-nastiness/#comment-1966</guid>
		<description>Talk about an obscure error. I&#039;ve been programming pages with SQL since version 6.5, and have never run into this one until now. If it wasnt for your blog, I&#039;d be hooped. Thanks for the help.</description>
		<content:encoded><![CDATA[<p>Talk about an obscure error. I&#8217;ve been programming pages with SQL since version 6.5, and have never run into this one until now. If it wasnt for your blog, I&#8217;d be hooped. Thanks for the help.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: TEB</title>
		<link>http://fugato.net/2005/02/08/sql-server-nastiness/comment-page-1/#comment-1882</link>
		<dc:creator>TEB</dc:creator>
		<pubDate>Fri, 09 Dec 2005 09:59:09 +0000</pubDate>
		<guid isPermaLink="false">http://fugato.net/2005/02/08/sql-server-nastiness/#comment-1882</guid>
		<description>Helped me too, Thanks!!</description>
		<content:encoded><![CDATA[<p>Helped me too, Thanks!!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: GÞB</title>
		<link>http://fugato.net/2005/02/08/sql-server-nastiness/comment-page-1/#comment-1773</link>
		<dc:creator>GÞB</dc:creator>
		<pubDate>Wed, 23 Nov 2005 02:44:00 +0000</pubDate>
		<guid isPermaLink="false">http://fugato.net/2005/02/08/sql-server-nastiness/#comment-1773</guid>
		<description>After nine-and-a-half months, I&#039;m glad it helped somebody :)</description>
		<content:encoded><![CDATA[<p>After nine-and-a-half months, I&#8217;m glad it helped somebody :)</p>
]]></content:encoded>
	</item>
</channel>
</rss>

