Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
latingntlman
Yak Posting Veteran
96 Posts |
Posted - 2008-05-06 : 16:32:57
|
I'm running a query into a temp table and it runs successfully but it displays the warning message when it finishes. The temp table is generated successfully, though.Message below:Warning: Null value is eliminated by an aggregate or other SET operation.Does anybody have any idea what may be causing this message and how to avoid it.thx,John |
|
cat_jesus
Aged Yak Warrior
547 Posts |
Posted - 2008-05-06 : 16:40:33
|
there is a null in your data.An infinite universe is the ultimate cartesian product. |
 |
|
sodeep
Master Smack Fu Yak Hacker
7174 Posts |
Posted - 2008-05-06 : 17:18:37
|
Disable warning messagesor use Coalesce or Isnull for this |
 |
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2008-05-07 : 04:17:59
|
How do you disable warning messages? E 12°55'05.25"N 56°04'39.16" |
 |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-05-07 : 08:16:42
|
quote: Originally posted by Peso How do you disable warning messages? E 12°55'05.25"N 56°04'39.16"
SET ANSI_WARNINGS OFF |
 |
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2008-05-07 : 08:34:23
|
Doesn't that trigger a recompile?http://www.novicksoftware.com/Articles/minimizing-stored-procedure-recompilation-page2.htmquote: Quote from Experts-Exchange "performance killer" In SQL 2000 I have an SP that gets called all the time from a .NET web application. I just discovered that when I run it in QA, I get warnings because of a RIGHT JOIN that sometimes returns NULL's when there are no matches in the left table. I hunted around and tried adding "SET ANSI_WARNINGS OFF" at the beginning of the SP, and "SET ANSI_WARNINGS ON" at the end of the SP. Cleared it up. But now I find the SP is taking a *lot* longer to run.Sorry for the long preface. If I set the warnings OFF, will they stay off until I set them on? And is there any penalty to just leaving the warnings off (or on for that matter, given the .net web interface)?
http://www.sqlservercentral.com/articles/Administering/ansioptionspart4ansi_warnings/786/ E 12°55'05.25"N 56°04'39.16" |
 |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-05-07 : 10:27:26
|
quote: Originally posted by Peso Doesn't that trigger a recompile?http://www.novicksoftware.com/Articles/minimizing-stored-procedure-recompilation-page2.htmquote: Quote from Experts-Exchange "performance killer" In SQL 2000 I have an SP that gets called all the time from a .NET web application. I just discovered that when I run it in QA, I get warnings because of a RIGHT JOIN that sometimes returns NULL's when there are no matches in the left table. I hunted around and tried adding "SET ANSI_WARNINGS OFF" at the beginning of the SP, and "SET ANSI_WARNINGS ON" at the end of the SP. Cleared it up. But now I find the SP is taking a *lot* longer to run.Sorry for the long preface. If I set the warnings OFF, will they stay off until I set them on? And is there any penalty to just leaving the warnings off (or on for that matter, given the .net web interface)?
http://www.sqlservercentral.com/articles/Administering/ansioptionspart4ansi_warnings/786/ E 12°55'05.25"N 56°04'39.16"
To be honest i've never used this myself, as i seldom care about this warning messages. But reading this it seems like its a real pain using this.Anyways, thanks a lot for the information provided Peso.Was really a new information for me. |
 |
|
|
|
|
|
|