Cannot insert an explicit value into a timestamp column. Use INSERT with a colimn list to exclude the timestamp column, or insert a DEFAULT into the timestamp column

Error:

"Cannot insert an explicit value into a timestamp column. Use INSERT with a colimn list to exclude the timestamp column, or insert a DEFAULT into the timestamp column" is a very common error you get from your .NET application when you use timestamp datatype in your SQL table and you try to insert the date in explicitly in that field.

Reason :

timestamp data type works in the same way as identity field. You don’t need to pass the value explicitly for this fields, SQL server automatically insert the value based on the system data and time.

Resolution:

If you wanted to insert a formatted date or time then you need to use datatime data type or change the SQL query.


No Comments