Transact-SQL Reference

sp_delete_log_shipping_plan

Deletes a log shipping plan.

Syntax

sp_delete_log_shipping_plan [ @plan_id = ] plan_id |
    [ @plan_name = ] 'plan_name'
    [ , [ @del_plan_db = ] del_plan_db ]

Arguments

[@plan_id =] plan_id

Is the identification number of the plan to delete. plan_id is uniqueidentifier, with a default of NULL.

[@plan_name =] 'plan_name'

Is the name of the plan to delete. plan_name is sysname, with a default of NULL.

Note  Either plan_id or plan_name must be specified; both cannot be specified.

[@del_plan_db =] del_plan_db

Specifies that all rows from log_shipping_databases table that belong to this plan will be deleted. del_plan_db is bit, with a default of 0.

Return Code Values

0 (success) or 1 (failure)

Remarks

If there are corresponding rows in the log_shipping_databases table, then del_plan_db must be set to one (1) or the stored procedure will fail.

Permissions

Only members of the sysadmin fixed server role can execute sp_delete_log_shipping_plan.

Examples

This example deletes the plan "Pubs database backup" and any databases added to the plan.

EXEC   msdb.dbo.sp_delete_log_shipping_plan @plan_name = N'Pubs database backup', @del_plan_db = 1