SET ANSI_NULLS ON的含义 [英] meaning of SET ANSI_NULLS ON
问题描述
朋友....
我想知道
的意思
Hi Friends....
I want to know the meaning of
SET ANSI_NULLS ON
AND
SET QUOTED_IDENTIFIER ON
推荐答案
您可以从链接中查看
http://blog.sqlauthority.com/2007 /03/05/sql-server-quoted_identifier-onoff-and-ansi_null-onoff-explanation/ [
You can check from the links
http://blog.sqlauthority.com/2007/03/05/sql-server-quoted_identifier-onoff-and-ansi_null-onoff-explanation/[^]
http://praveenbattula.blogspot.com/2009/05/use-of-set-ansinulls-on-in-sql-server.html
ANSI_NULLS ON
This option specifies the setting for ANSI NULL comparisons. When this is on, any query that compares a value with a null returns a 0. When off, any query that compares a value with a null returns a null value.
QUOTED IDENTIFIER ON/OFF:
This options specifies the setting for usage of double quotation. When this is on, double quotation mark is used as part of the SQL Server identifier (object name). This can be useful in situations in which identifiers are also SQL Server reserved words.
当
SET ANSI_NULLS ON
表示正在遵循ISO标准.
表示
=
和<>
不应用于空比较.
如果要使用= or <>
进行空比较,请使用
it means ISO Standard is being followed.
means
=
and <>
should not be used for null comparison.
If you want to use = or <>
for null comparison use
SET ANSI_NULLS OFF
表示不遵循ISO标准.
it means do not follow ISO Standard.
SET ANSI_NULLS
应该设置为ON以执行分布式查询
用于维护服务器之间查询的兼容性.
和
QUOTED_IDENTIFIER
它指定SQL Server如何处理单引号和双引号中定义的数据.当将其设置为ON时,双引号"中定义的任何字符集都将被视为T-SQL标识符(表名称,过程名称,列名称….etc),并且命名标识符的T-SQL规则将不被使用.适用于它.并且在单引号'中定义的任何字符集都被视为文字.
should be set to ON for executing distributed queries
for maintaining compatibility of queries accross Servers.
and
QUOTED_IDENTIFIER
It specifies how SQL Server treats the data that is defined in Single Quotes and Double Quotes. When it is set to ON any character set that is defined in the double quotes "" is treated as a T-SQL Identifier (Table Name, Proc Name, Column Name….etc) and the T-SQL rules for naming identifiers will not be applicable to it. And any character set that is defined in the Single Quotes ‘’ is treated as a literal.
请参阅以下内容:
http://stackoverflow.com/questions/9766717/in-sql-server-what-does-set-ansi-nulls-on-means [ http://msdn.microsoft.com/en-us/library/ms188048.aspx [ ^ ]
Refer these:
http://stackoverflow.com/questions/9766717/in-sql-server-what-does-set-ansi-nulls-on-means[^]
http://msdn.microsoft.com/en-us/library/ms188048.aspx[^]
这篇关于SET ANSI_NULLS ON的含义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!