Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
DB Engine
SQL ServerMSDESQL Server CE
Services
Analysis (Data Mining)Analysis (OLAP)DTSIntegration ServicesNotification ServicesReporting Services
Programming
CLRConnectivitySQLXML
Other Technologies
ClusteringEnglish QueryFull-Text SearchReplicationService Broker
General
Data WarehousingPerformanceSecuritySetupSQL Server ToolsOther SQL Server Topics
DirectoryUser Groups
Related Topics
MS AccessOther DB ProductsMS Server Products.NET DevelopmentVB DevelopmentJava DevelopmentMore Topics ...

SQL Server Forum / General / Other SQL Server Topics / August 2005

Tip: Looking for answers? Try searching our database.

SET ANSI_WARNINGS OFF in stored procs - how to avoid recompilation?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
nate.hughes@usa.net - 31 Aug 2005 14:22 GMT
Ok, here's my dilemma.  We're running SQL Server 2000 with the default
db setting for the ANSI_WARNINGS option set to off.  However, we still
get "Warning: Null value is eliminated by an aggregate or other SET
operation" messages.  To eliminate getting the message, we use the SET
ANSI_WARNINGS OFF in our stored procs.  Using that SET command forces a
recompilation of the SP and is causing locks/blocking.  Anybody else
run into this problem and if so, how have you handled it.

Thanks,
-Nate
Erland Sommarskog - 31 Aug 2005 23:18 GMT
> Ok, here's my dilemma.  We're running SQL Server 2000 with the default
> db setting for the ANSI_WARNINGS option set to off.  

There are several places where ANSI_WARNINGS can be set, and the principle
is simple: if it's set somewhere it set.

All client API activate ANSI_WARNINGS by default, except for DB-Library
and maybe really old versions of the ODBC driver.

> However, we still get "Warning: Null value is eliminated by an aggregate
> or other SET operation" messages.  To eliminate getting the message, we
> use the SET ANSI_WARNINGS OFF in our stored procs.  Using that SET
> command forces a recompilation of the SP and is causing locks/blocking.
> Anybody else run into this problem and if so, how have you handled it.
  SUM(coalesce(col, 0))

and things like that.

But since this is an informational message, it should not cause any
major problem.

Signature

Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinfo/productdoc/2000/books.asp

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.