Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Null in where clause
Message
From
23/02/2001 08:33:41
 
 
To
23/02/2001 08:27:50
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Miscellaneous
Thread ID:
00478555
Message ID:
00478777
Views:
28
From BOL

"For stored procedures, SQL Server uses the SET ANSI_NULLS setting value from the initial creation time of the stored procedure. Whenever the stored procedure is subsequently executed, the setting of SET ANSI_NULLS is restored to its originally used value and takes effect. When invoked inside a stored procedure, the setting of SET ANSI_NULLS is not changed."

To get the behavior that you want, SET ANSI_NULLS OFF before creating the stored procedure.

SET ANSI_NULLS OFF
GO
CREATE PROCEDURE x AS
blah blah blah
GO
SET ANSI_NULLS ON

The stored procedure will always run with ANSI_NULLS off.

-Mike
Michael Levy
MCSD, MCDBA
ma_levy@hotmail.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform