How to: Remove Log Shipping (Transact-SQL)

This topic explains how to remove log shipping using Microsoft SQL Server Transact-SQL.

To Remove Log Shipping

  1. On the primary server, execute sp_delete_log_shipping_primary_secondary to delete the information about the secondary database from the primary server.

  2. On the secondary server, execute sp_delete_log_shipping_secondary_database to delete the secondary database.

    Note

    If there are no other secondary databases with the same secondary ID, sp_delete_log_shipping_secondary_primary is invoked from sp_delete_log_shipping_secondary_database and deletes the entry for the secondary ID and the copy and restore jobs.

  3. On the primary server, execute sp_delete_log_shipping_primary_database to delete information about the log shipping configuration from the primary server. This also deletes the backup job.

  4. Delete the secondary database from the secondary server if desired.

See Also

Tasks

How to: Remove Log Shipping (SQL Server Management Studio)

Concepts

Log Shipping Tables and Stored Procedures

Other Resources

Log Shipping
sp_delete_log_shipping_primary_secondary (Transact-SQL)
sp_delete_log_shipping_secondary_database (Transact-SQL)
sp_delete_log_shipping_secondary_primary (Transact-SQL)
sp_delete_log_shipping_primary_database (Transact-SQL)

Help and Information

Getting SQL Server 2005 Assistance