T-SQL Tutorial

Msg 109 Level 15 - There are more columns in the INSERT statement


On Transact SQL language the Msg 109 Level 15 - There are more columns in the INSERT statement than values specified in the VALUES clause means that the number of values in the VALUES clause must match the number of columns specified in the INSERT statement.

Msg 109 Level 15 Example:

We have the table teachers:

USE model;
GO
CREATE TABLE teachers(
   ID INT IDENTITY NOT NULL PRIMARY KEY,
   Name VARCHAR(250) NOT NULL,
   Department VARCHAR(250) NOT NULL);
GO





Invalid insert:

USE model;
GO
INSERT INTO teachers(id, name, department)
VALUES ('Olivia Wilson'), ('Ethan Davis');
GO

Message
Msg 109, Level 15, State 1, Line 1
There are more columns in the INSERT statement than values specified in the VALUES clause. The number of values in the VALUES clause must match the number of columns specified in the INSERT statement.

Correct insert:

USE model;
GO
INSERT INTO teachers(name, department)
VALUES ('Olivia Wilson', 'Anthropology'), ('Ethan Davis', 'Biology');
GO

Message
(2 row(s) affected)

Other error messages: