6
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'.

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
user3533747
  • 57
  • 1
  • 2

2 Answers2

5

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')
Karl Kieninger
  • 8,841
  • 2
  • 33
  • 49
2

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');
Mudit
  • 69
  • 1
  • 11