Transact-SQL Reference

sp_add_log_shipping_database

Specifies that a database on the primary server is being log shipped.

Syntax

sp_add_log_shipping_database [ @db_name = ] 'db_name' ,
    [ @maintenance_plan_id = ] maintenance_plan_id

Arguments

[@db_name =] 'db_name'

The name of the database log shipped. The name must exist in sysdatabases. db_name is sysname.

[@maintenance_plan_id =] maintenance_plan_id

The maintenance plan responsible for backing up the transaction log of this database. maintenance_plan_id is uniqueidentifier, with a default of NULL.

Return Code Values

0 (success) or 1 (failure)

Permissions

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

Examples
EXEC   msdb.dbo.sp_add_log_shipping_database N'pubs'