473,473 Members | 1,821 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

How to check setting of CONCAT_NULL_YIELDS_NULL

I would like to check the setting of this variable in our MS-SQL 2000
database. Also, is there info on what the default value of this
variable is?

Feb 12 '08 #1
6 10027
On Feb 11, 7:55 pm, metaperl <metap...@gmail.comwrote:
Also, is there info on what the default value of this
variable is?
Found it - to check the current value , you can use SESSIONPROPERTY -
http://msdn2.microsoft.com/en-us/library/ms175001.aspx
Feb 12 '08 #2
You can also check the status of this option in your database using
DATABASEPROPERTYEX:
SELECT DATABASEPROPERTYEX('MyDatabase', 'IsNullConcat')

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.

HTH,

Plamen Ratchev
http://www.SQLStudio.com

Feb 12 '08 #3
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
Feb 12 '08 #4
"Erland Sommarskog" <es****@sommarskog.sewrote in message
news:Xn**********************@127.0.0.1...
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.

Correct. I just recently had this case at a client site where a third-party
app to bridge between DB2 and SQL Server was setting it to OFF, very
confusing until I found out.

>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.

Couldn't agree more. I haven't had a chance to look up those in SQL Server
2008. Any chance it will get better?

>
--
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

Plamen Ratchev
http://www.SQLStudio.com

Feb 12 '08 #5
Plamen Ratchev (Pl****@SQLStudio.com) writes:
>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.

Couldn't agree more. I haven't had a chance to look up those in SQL Server
2008. Any chance it will get better?
Not any that I have noticed.

The version after SQL 2008 will drop support for DB-Library, but I don't
think that will have any further repurcussions, although the database
options will become virtually meaningless (as if they are not already).

Maybe in SQL 2035 they will drop all legacy settings. But Microsoft
has some cleaning up in their own backyard to do. When you connect with
SQLCMD, QUOTED_IDENTIFIER is off by default.

--
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
Feb 12 '08 #6
I can understand keeping some legacy settings. But perhaps enforcing that
they are available in old compatibility mode only. Otherwise just too many
shops keep pushing it the old way until that moment the inevitable
happens...

Thanks Erland!

Plamen Ratchev
http://www.SQLStudio.com

Feb 12 '08 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Florian | last post by:
I need to set multiple values for some SQL statements, for example SET NUMERIC_ROUNDABORT OFF GO SET ANSI_PADDING,ANSI_WARNINGS,CONCAT_NULL_YIELDS_NULL,ARITHABORT,QUOTED_IDENTIF IER,ANSI_NULLS...
13
by: Robert McEuen | last post by:
This is probably really simple, but I can't find a thread that addresses it. Is there any way to evaluate in code whether the current state of the SetWarnings command is set to True or False? I...
0
by: talal | last post by:
How to check whether javascript is enable or disable in client browser. Remeber i can check wheter browser client support javascript with BrowserCapability class. But what if the client has disable...
0
by: MichaelH | last post by:
Hi, I've browsed through several sites I've found using google and have experimented with the code I have found, but I am still not able to accurately check if the proxy setting is set on my IE...
1
by: =?Utf-8?B?R2FuZXNoIE11dGh1dmVsdQ==?= | last post by:
Hello All, Our application write logs to a file in a folder. Before our application starts writing to that file, I want to check if the current user has write access to that file, for example,...
4
by: joemo2003 | last post by:
Is there a way to use VBA check to see the macro security setting? I want to use VBA check to see is the "Trust access to VB project" setting is on? Such as it return "True" when set to Trust access...
2
by: DesCF | last post by:
I have a textbox and a combobox on a toolstrip. The user enters either an ID in the textbox or selects a name from the combobox. When the user selects a name from the combobox the textbox is...
4
by: Paul | last post by:
How do I default a Check Box to have the tick already in it
1
parshupooja
by: parshupooja | last post by:
Hey all, I have check box list on which is binded to one of the coulmn in table A. It is not bit column 40 50 60 70 In another table B have value in one row named like 40, 50, 60 etc While...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.