SQL中 SET QUOTED_IDENTIFIER OFF语句的作用
代码
Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--> 1 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 QUOTED_IDENTIFIER ON 双引号" "等同于[ ] 表示数据库对象;当SET QUOTED_IDENTIFIER OFF 双引号" "等同于单引号' '表示字符串边界;还有这里的双引号" 并不是两个单引号'合起来的,是shift+”打出来的,初学者可能会犯这样的错误。