Skip to content
  • There are no suggestions because the search field is empty.

Error inserting a value into a 'timestamp' column

The following error occurs when logging to SQL Server:

Event Type: Error
Occurred At: [some date time]
From Location: Data Logger Logging
MessageData Storage [name of your data store] encountered Exception: Cannot insert an explicit value into a timestamp column. Use INSERT with a column list to exclude the timestamp column, or insert a DEFAULT into the timestamp column. Requesting Shutdown.

This particular error is coming from the SQL Server database itself. It is caused by attempting to insert into a field of type timestamp that is a read-only field, and applies to all versions of SQL Server.

There are 2 data types for storing a timestamp:

  • datetime
  • timestamp

The solution is to use the datatype DATETIME, because it is a read/write data-type.

'Timestamp' is a fully automated datatype. When a record is inserted into a table that contains this data-type, the SQL Server database will automatically store the current timestamp into the column. Because this is automated, this is the reason why you are seeing this error because the OPC Data Logger is trying to pass the timestamp it generated into this column.

This is a feature of SQL Server. Data Logger will be unable to insert a timestamp if the database architecture requires a the field to be of type 'timestamp'.