Top menu

"[Microsoft][ODBC SQL Server Driver][SQL Server]Adding a value to a 'datetime' column caused overflow." error when upgrading DeviceLock Enterprise Server


The "[Microsoft][ODBC SQL Server Driver][SQL Server]Adding a value to a 'datetime' column caused overflow." error occurs during "Upgrading the database..." process when installing a new version of DeviceLock Enterprise Server over the older one (upgrading the server).


The error indicates that the value of the "DateTime" column in DLAuditLog and/or DLShadowFiles tables for various records is invalid.


The invalid values must be replaced with the correct ones taken from other Records.

1. To find out which records caused overflow problem make the following queries and check the output:

select * from DLAuditLog where CreationDate < 47966687999990000

select * from DLShadowFiles where CreationDate < 47966687999990000

2. For instance, the output is:

1    654019    1054    1    144164531250    19    8
C:\WINDOWS\system32\DLService.exe    1128    Started    NULL    Version:    NULL    255    Service
1    5967974    1054    1    144204687500    19    8
C:\WINDOWS\system32\DLService.exe    1124    Started    NULL    Version:    NULL    255    Service
1    16363276    1675    1    180144062500    19    8
C:\WINDOWS\system32\DLService.exe    1116    Started    NULL    Version:    NULL    255    Service
1    18421125    1054    1    180225312500    19    8
C:\WINDOWS\system32\DLService.exe    1128    Started    NULL    Version:    NULL    255    Service

Where  654019, 5967974, 16363276, 18421125 are record ID's with the invalid values for the "datetime" coulumn.

3. DateTime value for records with the above ID's must be replaced with the value from records with any other ID, not listed in the first output, e.g. 5967973. You will have to execute the query:

update DLAuditLog set CreationDate = (select CreationDate from DLAuditLog where RecordId=5967973) where RecordId in (654019, 5967974, 16363276, 18421125)

3. The same applies to DLShadowFiles if there are any results returned for it in the first (pt.1) query.