Click here to Skip to main content
11,804,008 members (73,422 online)
Rate this: bad
Please Sign up or sign in to vote.
See more: SQL-server-2005 VB SQL-Server , +
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
0 OriginalGriff 3,140
1 Maciej Los 1,910
2 KrunalRohit 1,907
3 CPallini 1,845
4 Richard MacCutchan 1,187

Advertise | Privacy | Mobile
Web04 | 2.8.151002.1 | Last Updated 8 Feb 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

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