Click here to Skip to main content
13,559,672 members
Rate this:
Please Sign up or sign in to vote.
i am getting the following error while i running my ASP.Net Application in Server,
what may be the solution?

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.
Posted 7-Feb-13 22:03pm
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

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.

For ex;
USE tempDB
 c1 INT
 , c2 INT
INSERT INTO #t (c1, c2) VALUES(1)

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.

Good luck,
Rate this: bad
Please Sign up or sign in to vote.

Solution 3

The number of values that you are trying to insert is much more than the columns in your database table.
if it is a long SQL query then paste it into excel or notepad or something and verify it. It is a pain, I get it often as well

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Cookies | Terms of Service
Web04-2016 | 2.8.180527.1 | Last Updated 8 Feb 2013
Copyright © CodeProject, 1999-2018
All Rights Reserved.
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100