October 16, 2002 at 8:54 am
I'm almost dreading asking ths , becuase I just KNOW the anser is going to be something simple.
I was testing ANSI_WARNINGS. I ran the code
SELECT TRGROSS/TRNETT FROM GTF
...when I know TRNETT has some zero values. I get the ol' "Divide by zero" error. Fine
Stop me if I'm wrong but isn't SET ANSI_WARNINGS OFF supposed to avoid this warning, & just return NULL in the expression? I run SET ANSI_WARNINGS OFF then the query in the same batch & still get the warning?
October 16, 2002 at 8:56 am
...and I'm running 2000 Personal Ed + SP2 on Win2k. I was working in a simple QA session logged in as SA.
October 16, 2002 at 9:09 am
No cos divide by zero is an error not a warning, warnings are like NULL eliminiated from aggregate
set ansi_warnings off
select sum(cast(null as int))
GO
set ansi_warnings on
select sum(cast(null as int))
Simon Sabin
Co-author of SQL Server 2000 XML Distilled
http://www.amazon.co.uk/exec/obidos/ASIN/1904347088
Simon Sabin
SQL Server MVP
http://sqlblogcasts.com/blogs/simons
October 16, 2002 at 9:14 am
You need to look at arithabort and arithignore
Simon Sabin
Co-author of SQL Server 2000 XML Distilled
http://www.amazon.co.uk/exec/obidos/ASIN/1904347088
Simon Sabin
SQL Server MVP
http://sqlblogcasts.com/blogs/simons
October 16, 2002 at 9:17 pm
So I was looking at grid pane when I should have been looking at the messages pane. Damn I knew it was something simple! Thank U
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply