--- title: "sp_delete_log_shipping_secondary_database (Transact-SQL) | Microsoft Docs" ms.custom: "" ms.date: "03/14/2017" ms.prod: "sql-non-specified" ms.reviewer: "" ms.suite: "" ms.technology: - "database-engine" ms.tgt_pltfrm: "" ms.topic: "language-reference" f1_keywords: - "sp_delete_log_shipping_secondary_database_TSQL" - "sp_delete_log_shipping_secondary_database" dev_langs: - "TSQL" helpviewer_keywords: - "sp_delete_log_shipping_secondary_database" ms.assetid: c71b21c0-ec04-4fbd-9735-01128b736935 caps.latest.revision: 20 author: "JennieHubbard" ms.author: "jhubbard" manager: "jhubbard" --- # sp_delete_log_shipping_secondary_database (Transact-SQL) [!INCLUDE[tsql-appliesto-ss2008-xxxx-xxxx-xxx_md](../../includes/tsql-appliesto-ss2008-xxxx-xxxx-xxx-md.md)] This stored procedure removes a secondary database and removes the local history and remote history. || |-| |**Applies to**: [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] ([!INCLUDE[ssKatmai](../../includes/sskatmai-md.md)] through [current version](http://go.microsoft.com/fwlink/p/?LinkId=299658)).| ![Topic link icon](../../database-engine/configure-windows/media/topic-link.gif "Topic link icon") [Transact-SQL Syntax Conventions](../../t-sql/language-elements/transact-sql-syntax-conventions-transact-sql.md) ## Syntax ``` sp_delete_log_shipping_secondary_database [ @secondary_database = ] 'secondary_database' ``` ## Arguments [ **@secondary_database =** ] '*secondary_database*' Is the name of the secondary database. *secondary_database* is **sysname**, with no default. ## Return Code Values 0 (success) or 1 (failure) ## Result Sets None. ## Remarks **sp_delete_log_shipping_secondary_database** must be run from the **master** database on the secondary server. ## Permissions Only members of the **sysadmin** fixed server role can run this procedure. ## See Also [About Log Shipping (SQL Server)](../../database-engine/log-shipping/about-log-shipping-sql-server.md) [System Stored Procedures (Transact-SQL)](../../relational-databases/system-stored-procedures/system-stored-procedures-transact-sql.md)