INSERT INTO query returning "Unclosed quotation mark after the character string"

sql, sql-server

Solution

I'm guessing one of the strings you're trying to insert has an apostrophe in it. Depending on how you're creating the query you can use parameters or escape the apostrophe:

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

Problem

I have tried looking everywhere within the site and within Microsoft documentation, but I am stuck at running a query to insert objects into my table. What am I doing wrong to get the "Unclosed quotation mark after the character string 'cate'" error? Here is the query: ``` 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); ```

Original source