dcsimg

Deleting scheduled job returns error, “The DELETE statement conflicted with the REFERENCE constraint “FK5WT_MonitorResult”

Products

Webtrends Analytics 8.x
Webtrends Analytics 9.x

Issue

When attempting to delete a scheduled job the following error displays:

An internal error occurred

Message: The error ‘The DELETE statement conflicted with the REFERENCE constraint “FK5WT_MonitorResult”. The conflict occurred in database “wt_sched”, table “dbo.WT_MonitorResult”, column ‘EventID’.’ occurred while running a SQL Query (see SQL in log file).

Information: Main_EventsPanel(): error deleting event!

Note: Despite the similarities in the displayed error message, this article applies only to the versions of the product listed above.

Resolution

Truncate the WT.MonitorResult table by running the following MS SQL statements.

DELETE FROM wt_sched.dbo.WT_MonitorResultAction;
DELETE FROM wt_sched.dbo.WT_MonitorAlertResolveHistory;
DELETE FROM wt_sched.dbo.WT_MonitorResult;

The job can now be deleted normally from the administration console. This will also result in all active, deferred, and past alerts being removed from the user interface.