INSERT INTO查询返回“字符串后面的未闭合引号”

时间:2013-07-01 19:25:43

标签: sql sql-server

我已尝试在网站内和Microsoft文档中查找,但我仍然坚持运行查询以将对象插入到我的表中。

我做错了什么?
  

字符串'cate'“

后的未闭合引号

错误?

以下是查询:

INSERT INTO t_lu_Product ([product_id], [description], [isCompetition], [category], 
                          [subCategory], [brand], [type], [returnability], [capacity]) 
VALUES(200011073, '1.25L PNR CC', 1, 'Cola',
       'Cola Regular', 'Coca-Cola', 'Familiares', 'No Retornable', 1);

1 个答案:

答案 0 :(得分:5)

我猜测你要插入的其中一个字符串中有一个撇号。根据您创建查询的方式,您可以使用参数或转义撇号:

INSERT INTO t_lu_Product ( ... ) VALUES(... ,'Mother''s Cookies',1);