Plamen Ratchev (Pl****@SQLStudio.com) writes:
You can also check the status of this option in your database using
DATABASEPROPERTYEX:
SELECT DATABASEPROPERTYEX('MyDatabase', 'IsNullConcat')
But that setting applies only to clients that uses a legacy API. That is,
by setting this setting ON, you can force a client that connects with
DB-Library to have CONACT_NULL_YIELDS_NULL on. Another way to do this is
the server-level configuration option 'user options'.
If you connect with a modern API, you will have CONCAT_NULL_YIELDS_NULL on
even if the database setting is off.
But since the connection level settings can override the default
database setting, using SESSIONPROPERTY('CONCAT_NULL_YIELDS_NULL') will
give you the value for the current session.
Yes, that is the one to check.
The same applies to other ANSI settings. Except that for ANSI_NULL and
QUOTED_IDENTIFIER, the setting is saved with the stored procedure.
Very, very confusing.
--
Erland Sommarskog, SQL Server MVP,
es****@sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx