I\'ve got a query with a WHERE
clause that contains a condition that checks a NULLable column against a parameter that may be NULL, like so:>
Try altering the stored procedure in a session after setting ANSI_NULLS to ON.
SET ANSI_NULLS ON
GO
alter procedure procedureName
...
From the docs:
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.