| title | sp_delete_log_shipping_secondary_database (Transact-SQL) | ||
|---|---|---|---|
| description | Removes a secondary database and removes the local history and remote history. | ||
| author | MashaMSFT | ||
| ms.author | mathoma | ||
| ms.reviewer | randolphwest | ||
| ms.date | 06/23/2025 | ||
| ms.service | sql | ||
| ms.subservice | system-objects | ||
| ms.topic | reference | ||
| f1_keywords |
|
||
| helpviewer_keywords |
|
||
| dev_langs |
|
[!INCLUDE SQL Server]
This stored procedure removes a secondary database and removes the local history and remote history.
:::image type="icon" source="../../includes/media/topic-link-icon.svg" border="false"::: Transact-SQL syntax conventions
sp_delete_log_shipping_secondary_database
[ @secondary_database = ] N'secondary_database'
[ , [ @ignoreremotemonitor = ] ignoreremotemonitor ]
[ ; ]
The name of the secondary database. @secondary_database is sysname, with no default.
[!INCLUDE ssinternalonly-md]
0 (success) or 1 (failure).
None.
sp_delete_log_shipping_secondary_database must be run from the master database on the secondary server.
Only members of the sysadmin fixed server role can run this procedure.