INSERT INTO FoodLog
(Person,Food,ServingSize,Date,Meal)
VALUES
('John','Cheerios',2,'1-APR-2014','Breakfast')
('John','TBoneSteak',1,'2-APR-2014','Lunch')
In this code, the first line of code works just fine, but when I type up the second line of code with the same person name, it doesn't accept it.
This is the error that I receive:
Msg 102, Level 15, State 1, Line 5
Incorrect syntax near 'John'.
For the sake of having an answer rather than a comment. Exactly as @helderdarocha said, "You are missing a comma in between the lines."
INSERT INTO FoodLog (Person,Food,ServingSize,Date,Meal)
VALUES ('John','Cheerios',2,'1-APR-2014','Breakfast')
,('John','TBoneSteak',1,'2-APR-2014','Lunch')
As @helderdarocha and @Karl Kieninger said you are missing a comma between the tuples or if you still cant resolve the issue, try writing individual entries....I can`t think of anything else possible...
INSERT INTO FoodLog VALUES ('John','Cheerios',2,'1-APR-2014','Breakfast');
INSERT INTO FoodLog VALUES ('John','TBoneSteak',1,'2-APR-2014','Lunch');
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With