【发布时间】:2015-12-08 04:55:26
【问题描述】:
我想知道使用引号引起此错误的确切原因。
INSERT INTO table_check(name) VALUES('hello'hi') -- ERROR
INSERT INTO table_check(name) VALUES('hello''hi') -- RESULT:- hello'hi
INSERT INTO table_check(name) VALUES('hello'''hi') --ERROR
INSERT INTO table_check(name) VALUES('hello''''hi') --RESULT:- hello''hi
INSERT INTO table_check(name) VALUES('hello'''''hi') --ERROR
INSERT INTO table_check(name) VALUES('hello''''''hi') --RESULT:- hello'''hi
【问题讨论】:
-
简单的答案是单引号的数量应该是偶数,否则会有未闭合的引号
标签: sql sql-server sql-server-2008