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.

Error Message:
Server: Msg 109, Level 15, State 1, Line 6
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.

Severity level:
15.

Description:
This error message appears when you try to INSERT a row into a table and there are more columns in that table than you have supplied in the VALUES clause.

Consequences:
The INSERT statement cannot be committed and is rolled back.

Resolution:
Error of the severity level 15 are generated by the user and can be fixed by the SQL Server user.

Versions:
All versions of SQL Server.

Example(s):
USE tempDB
GO
CREATE TABLE #t
(
 c1 INT
 , c2 INT
)
INSERT INTO #t (c1, c2) VALUES(1)

Remarks:
As you can see in the above example the table #t contains the column c1 and c2. In the INSERT statement which is intended to affect both columns c1 and c2, however, there is only 1 value supplied. In order to successfully run the INSERT statement, you need to correct either the column list or the VALUES list. Both must contain exactly the same number of arguments.




Related Articles :

  • No Related Articles Found

No comments yet... Be the first to leave a reply!

Software Reviews | Book Reviews | FAQs | Tips | Articles | Performance Tuning | Audit | BI | Clustering | Developer | Reporting | DBA | ASP.NET Ado | Views tips | | Developer FAQs | Replication Tips | OS Tips | Misc Tips | Index Tuning Tips | Hints Tips | High Availability Tips | Hardware Tips | ETL Tips | Components Tips | Configuration Tips | App Dev Tips | OLAP Tips | Admin Tips | Software Reviews | Error | Clustering FAQs | Performance Tuning FAQs | DBA FAQs |