sp_delete_log_shipping_plan_database

Transact-SQL Reference

Transact-SQL Reference

sp_delete_log_shipping_plan_database

Removes a database from a log shipping plan.

Syntax

sp_delete_log_shipping_plan_database [ @plan_id = ] plan_id ,
    [ @plan_name = ] 'plan_name' ,
    [ @destination_database = ] 'destination_database'

Arguments

[@plan_id =] plan_id

Is the identification number of the plan in which the database belongs. plan_id is uniqueidentifier, with a default of NULL.

[@plan_name =] 'plan_name'

Is the name of the plan in which the database belongs. plan_name is sysname, with a default of NULL.

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

[@destination_database =] 'destination_database'

Is the name of the database to be removed from the plan. destination_database is sysname with a default of NULL. Wildcard pattern matching is supported.

Return Code Values

0 (success) or 1 (failure)

Remarks

Removes matching databases from log_shipping_plan_databases table.

Permissions

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

Examples

This example removes "pubs2" from the plan "Pubs database backup."

EXEC   msdb.dbo.sp_delete_log_shipping_plan_database @plan_name = N'Pubs database backup', @destination_database = N'pubs2'