SQL Flow Field Guide

sys.sp_add_log_shipping_secondary_database

Check SQL Server version support in the source

Sets up a secondary database for log shipping.

What changes

Input
Not stated in the Microsoft summary.
Output or change
Sets up a secondary database for log shipping.

Syntax at a glance

sys.sp_add_log_shipping_secondary_database
    [ @secondary_database = ] N'secondary_database'
    , [ @primary_server = ] N'primary_server'
    , [ @primary_database = ] N'primary_database'
    [ , [ @restore_delay = ] restore_delay ]
    [ , [ @restore_all = ] restore_all ]
    [ , [ @restore_mode = ] restore_mode ]
    [ , [ @disconnect_users = ] disconnect_users ]
    [ , [ @block_size = ] block_size ]
    [ , [ @buffer_count = ] buffer_count ]
    [ , [ @max_transfer_size = ] max_transfer_size ]
    [ , [ @restore_threshold = ] restore_threshold ]
    [ , [ @threshold_alert = ] threshold_alert ]
    [ , [ @threshold_alert_enabled = ] threshold_alert_enabled ]
    [ , [ @history_retention_period = ] history_retention_period ]
    [ , [ @overwrite = ] overwrite ]
    [ , [ @ignoreremotemonitor = ] ignoreremotemonitor ]
[ ; ]

Work example

Sets up a secondary database for log shipping.

Write a proposed call on paper. Name the target, required permission, expected change, and recovery step before any lab use.

Check your work What can this procedure change or start, and what permission does it need?

Open Microsoft Learn for full syntax, permissions, and details for your version.