Click here to Skip to main content
15,066,066 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have excel sheet contains some data.

When i importing the excel sheet to database it shows error like this

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

because i have column name "id" set as identity specification "yes" and its datatype is "unique identifier" in database table....So I got these error....

What is the solution to recover this problem....

Can anyone help me....


Set the option identity insert ON...
vivekx2 5-Apr-12 11:59am
Its already Identity Insert is ON
You have to provide a value for the UniqueIdentifier field. If this is a one time thing you may want to remove the column, do the import, and add it back. Or you can generate values in the Excel file and import them in. Or just take off the identity and allow null and then set it back.
You can either generate random ID in the Excel file or get rid of the identity. From my experience, I would choose the first one, especially interact with the costoms. But you d better to feed back the generated ID to them.

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

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900