---
title: "Remove a Secondary Database from a Log Shipping Configuration (SQL Server) | Microsoft Docs"
ms.custom: ""
ms.date: "03/14/2017"
ms.prod: "sql-server-2016"
ms.reviewer: ""
ms.suite: ""
ms.technology:
- "dbe-high-availability"
ms.tgt_pltfrm: ""
ms.topic: "article"
helpviewer_keywords:
- "deleting secondary databases"
- "secondary databases [SQL Server], in log shipping"
- "removing secondary databases"
- "secondary data files [SQL Server], removing"
- "log shipping [SQL Server], secondary databases"
ms.assetid: ebe368a4-ca1c-45d0-9a71-3ddbd5b26a8e
caps.latest.revision: 19
author: "MikeRayMSFT"
ms.author: "mikeray"
manager: "jhubbard"
---
# Remove a Secondary Database from a Log Shipping Configuration (SQL Server)
This topic describes how to remove a log shipping secondary database in [!INCLUDE[ssCurrent](../../includes/sscurrent-md.md)] by using [!INCLUDE[ssManStudioFull](../../includes/ssmanstudiofull-md.md)] or [!INCLUDE[tsql](../../includes/tsql-md.md)].
**In This Topic**
- **Before you begin:**
[Security](#Security)
- **To remove a log shipping secondary database, using:**
[SQL Server Management Studio](#SSMSProcedure)
[Transact-SQL](#TsqlProcedure)
- [Related Tasks](#RelatedTasks)
## Before You Begin
### Security
#### Permissions
The log-shipping stored procedures require membership in the **sysadmin** fixed server role.
## Using SQL Server Management Studio
#### To remove a log shipping secondary database
1. Connect to the instance of [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] that is currently the log shipping primary server and expand that instance.
2. Expand **Databases**, right-click the log shipping primary database, and then click **Properties**.
3. Under **Select a page**, click **Transaction Log Shipping**.
4. Under **Secondary server instances and databases**, click the database you want to remove.
5. Click **Remove**.
6. Click **OK** to update the configuration.
## Using Transact-SQL
#### To Remove a Secondary Database
1. On the primary server, execute [sp_delete_log_shipping_primary_secondary](../../relational-databases/system-stored-procedures/sp-delete-log-shipping-primary-secondary-transact-sql.md) to delete the information about the secondary database from the primary server.
2. On the secondary server, execute [sp_delete_log_shipping_secondary_database](../../relational-databases/system-stored-procedures/sp-delete-log-shipping-secondary-database-transact-sql.md) to delete the secondary database.
> [!NOTE]
> If there are no other secondary databases with the same secondary ID, **sp_delete_log_shipping_secondary_primary** is invoked from **sp_delete_log_shipping_secondary_database** and deletes the entry for the secondary ID and the copy and restore jobs.
3. On the secondary server, disable the copy and restore jobs. For more information, see [Disable or Enable a Job](http://msdn.microsoft.com/library/5041261f-0c32-4d4a-8bee-59a6c16200dd).
## Related Tasks
- [Upgrading Log Shipping to SQL Server 2016 (Transact-SQL)](../../database-engine/log-shipping/upgrading-log-shipping-to-sql-server-2016-transact-sql.md)
- [Configure Log Shipping (SQL Server)](../../database-engine/log-shipping/configure-log-shipping-sql-server.md)
- [Add a Secondary Database to a Log Shipping Configuration (SQL Server)](../../database-engine/log-shipping/add-a-secondary-database-to-a-log-shipping-configuration-sql-server.md)
- [Remove Log Shipping (SQL Server)](../../database-engine/log-shipping/remove-log-shipping-sql-server.md)
- [View the Log Shipping Report (SQL Server Management Studio)](../../database-engine/log-shipping/view-the-log-shipping-report-sql-server-management-studio.md)
- [Monitor Log Shipping (Transact-SQL)](../../database-engine/log-shipping/monitor-log-shipping-transact-sql.md)
- [Fail Over to a Log Shipping Secondary (SQL Server)](../../database-engine/log-shipping/fail-over-to-a-log-shipping-secondary-sql-server.md)
## See Also
[About Log Shipping (SQL Server)](../../database-engine/log-shipping/about-log-shipping-sql-server.md)
[Log Shipping Tables and Stored Procedures](../../database-engine/log-shipping/log-shipping-tables-and-stored-procedures.md)