Monday, March 12, 2012

Problems with Identity column

Got this error:

"An explicit value for the identity column in table 'sdk_appsettings' can only be specified when a column list is used and IDENTITY_INSER is on"

Any idea?

Also what is MAX in nvarchar(max)?

If you have Identity column in your table and you supply a value when you are inserting a record, then above error will be thrown. Identity column has its own rules - they are normally incremented each time by a specific value for example 1. When inserting identity column value should not be supplied.|||

i understand that identity columns have its own problems but i am facing problem while inserting data into such columns.

i did not supply the identity column while inserting the data. and it works quite well. but when i upload my project on the web server then it says that the value of my identity column cannot be null as i am not specifying it in my identity column.

can you suggest me anything to find the solution. i am using asp.net 2003 and SQL Server 2000

|||I would look at your production database and make sure that column is an identity column. It probably isn't.

No comments:

Post a Comment