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

jab*_*lla 2 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);
Run Code Online (Sandbox Code Playgroud)

D S*_*ley 5

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

INSERT INTO t_lu_Product ( ... ) VALUES(... ,'Mother''s Cookies',1);
Run Code Online (Sandbox Code Playgroud)