-- ****** Failover the Mirroring Partner to setup Log Shipping for Failover ******
:CONNECT SQL2K12-SVR2

EXEC master.dbo.sp_delete_log_shipping_primary_secondary
		@primary_database = N'CreditReporting'
		,@secondary_server = N'SQL2K12-SVR4'
		,@secondary_database = N'CreditReporting';
GO

EXEC master.dbo.sp_delete_log_shipping_primary_database @database = N'CreditReporting' ;
GO

ALTER DATABASE [CreditReporting]
SET PARTNER FAILOVER;
GO


-- Now cleanup SVR1
:CONNECT SQL2K12-SVR1

EXEC master.dbo.sp_delete_log_shipping_primary_secondary
		@primary_database = N'CreditReporting'
		,@secondary_server = N'SQL2K12-SVR4'
		,@secondary_database = N'CreditReporting';
GO

EXEC master.dbo.sp_delete_log_shipping_primary_database @database = N'CreditReporting' ;
GO

-- Drop LS Secondary database copy which is now Restoring... on SVR4
:CONNECT SQL2K12-SVR4
DROP DATABASE [CreditReporting];
GO

:CONNECT SQL2K12-SVR3
use msdb;

EXEC sp_delete_log_shipping_monitor_info
   @primary_server_name = 'SQL2K12-SVR1',
   @primary_database_name = 'CreditReporting',
   @secondary_server_name = 'SQL2K12-SVR4',
   @secondary_database_name = 'CreditReporting'
GO