INSERT INTO statement in SQL Server

I am trying to enter information into a table called Food_Log.

INSERT INTO Food_Log
(Person, Food, ServingSize, Date, Meal);
VALUES
(John,'Cheerios',2,'1-APR-2014','Breakfast');

Because of this entry, the following error occurs.

Msg 102, level 15, state 1, line 2
Invalid syntax next to ';'.

Not sure what to do to get around this.

-3
source share
1 answer

Remove ;toVALUES

INSERT INTO Food_Log (Person, Food, ServingSize, Date, Meal)
VALUES ('John','Cheerios',2,'2014-04-01','Breakfast');

And the date format is usually YYYY-MM-DD. And you forgot the quotes aroundJohn

0
source

Source: https://habr.com/ru/post/1537161/


All Articles