Error: Cannot insert the value NULL into column 'DatabaseID', table 'LiteSpeedLocal.dbo.LitespeedActivity'; column does not allow nulls. INSERT fails
or
Procedure LiteSpeed_InsertUpdateDatabaseActivity, Line 57 Cannot insert the value NULL into column 'DatabaseID', table 'LiteSpeedLocal.dbo.LitespeedActivity'; column does not allow nulls. INSERT fails.
LiteSpeed_UpdateDatabase never inserted the database name into the LiteSpeed table because it didn't exist in sysdatabases (because the database had been renamed).
WORKAROUND:
First run the following:
UseLiteSpeedLocal
Go
ExecLiteSpeed_ImportNativeHistory
Go
Output:
Msg 515, Level 16, State 2, Procedure LiteSpeed_InsertUpdateDatabaseActivity, Line 57
Cannot insert the value NULL into column 'DatabaseID', table 'LiteSpeedLocal.dbo.LitespeedActivity'; column does not allow nulls. INSERT fails.
The statement has been terminated.
Msg 547, Level 16, State 0, Procedure LiteSpeed_InsertUpdateBackupFile, Line 14
The INSERT statement conflicted with the FOREIGN KEY constraint "FK_LitespeedBackupFile_LitespeedActivity". The conflict occurred in database "LiteSpeedLocal", table "dbo.LitespeedActivity".
The statement has been terminated.
Run this again:
UseLiteSpeedLocal
Go
ExecLiteSpeed_ImportNativeHistory
Go
Output:
Command(s) completed successfully.