原文发布时间为:2008-09-27 —— 来源于本人的百度文章 [由搬家工具导入]
set ansi_nulls [on/off] 与 set quoted_identifier [on/off] 和SET NOCOUNT [on/off]
set ansi_nulls [on/off] 跟null等相关
set ansi_nulls off
可以使用=做比较 select * from a where price=null 若此时a中有price為NULL的就可以选出來
而在set ansi_nulls on时候
只能写 select * from a where price is null
set quoted_identifier [on/off] 跟标示符相关
set quoted_identifier on
“当 SET QUOTED_IDENTIFIER 为 ON 时,标识符可以由双引号分隔,而文字必须由单引号分隔。当 SET QUOTED_IDENTIFIER 为 OFF 时,标识符不可加引号,且必须遵守所有 Transact-SQL 标识符规则。”
SET QUOTED_IDENTIFIER ON
SELECT * FROM "USER" WHERE a='netasp'
SET QUOTED_IDENTIFIER ON
SELECT * FROM [USER] WHERE a='netasp'
SET QUOTED_IDENTIFIER OFF
SELECT * FROM [USER] WHERE a="netasp"
SET QUOTED_IDENTIFIER OFF
SELECT * FROM [USER] WHERE a= ' netasp'
当 SET NOCOUNT 为 ON 时,不返回计数(表示受 Transact-SQL 语句影响的行数)。当 SET NOCOUNT 为 OFF 时,返回计数。
如果存储过程中包含的一些语句并不返回许多实际的数据,则该设置由于大量减少了网络流量,因此可显著提高性能。