Log Shipping Information from Primary and Secondary Log Shipping server

SET NOEXEC OFF DECLARE @primaryORsecondaryserver varchar(100); DECLARE @PrimaryServerBackupType varchar(100); DECLARE @SecondaryServerCopyType varchar(100); SET @primaryORsecondaryserver = (SELECT top 1 agent_type from [msdb].[dbo].[log_shipping_monitor_history_detail]) SET @PrimaryServerBackupType = ‘0’ SET @SecondaryServerCopyType = ‘1’ IF (@primaryORsecondaryserver = @PrimaryServerBackupType ) BEGIN SELECT MP.[primary_server] as [Primary Server] ,MP.[primary_database] ,PB.[backup_directory] ,PB.[backup_share] ,MP.[last_backup_file] ,PB.[backup_retention_period] ,MP.[backup_threshold] ,MP.[last_backup_date] FROM [msdb].[dbo].[log_shipping_monitor_primary] AS MP JOIN [msdb].[dbo].[log_shipping_primary_databases] AS PB […]

Read More