Import Data from Excel Error: Cannot insert explicit value for identity column in table when IDENTITY_INSERT is set to OFF

Last Reply one month ago By pandeyism

Posted one month ago

when i am import data into table from excel sheet ...it giving error of Cannot insert explicit value for identity column in table 'OrderDetail' when IDENTITY_INSERT is set to OFF. 

I did n't define my first column Name in my excel sheet ,because it number auto generating ,so how can i managed it before importing data into db table 

My table column is  

CREATE TABLE #Orderdetail(ODID INT IDENTITY(1,1) NOT NULL,Codeitem int,orderqty int);

ODID column is auto generated number in my table and i do not mentioned this column in my excel sheet.

so how to avoid this error.

This question does not have replies that have been liked.