Skip to content
Advertisement

Insert query: Column name or number of supplied values does not match table definition

This is a table that auto increments the ID, takes the time input, and sets the default of the total column as zero and the date column with getdate()

So the only value that I have to insert is the time.

However on insertion SQL Server gives me this error:

Column name or number of supplied values does not match table definition.

Advertisement

Answer

You need to specify the column name as well, like this:

INSERT INTO table_name (column1, column2, column3, ...) VALUES (value1, value2, value3, ...);

So it will be like this:

insert into OrderPlaced values ('13:40');

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement