sp_help_log_shipping_monitor may return the following error after role reversal in SQL 2000/2005 : Violation of PRIMARY KEY constraint <constraint name>. Cannot insert duplicate key in object 'dbo.#log_shipping_monitor'

Problem Description =============== ·         After role reversal in a log shipping setup, the stored procedure sp_help_log_shipping_monitor may return the following error OR we may find the error in the log shipping report in SQL Server Management Studio. Msg 2627, Level 14, State 1, Procedure sp_help_log_shipping_monitor, Line 148 Violation of PRIMARY KEY constraint ‘PK__#log_shipping_mo__15502E78’. Cannot insert…