Skip to content

Latest commit

 

History

History
67 lines (47 loc) · 2.27 KB

sp-removedistpublisherdbreplication-transact-sql.md

File metadata and controls

67 lines (47 loc) · 2.27 KB
title description author ms.author ms.reviewer ms.date ms.service ms.subservice ms.topic f1_keywords helpviewer_keywords dev_langs
sp_removedistpublisherdbreplication (Transact-SQL)
sp_removedistpublisherdbreplication removes publishing metadata belonging to a specific publication at the Distributor.
markingmyname
maghan
randolphwest
08/22/2024
sql
replication
reference
sp_removedistpublisherdbreplication_TSQL
sp_removedistpublisherdbreplication
sp_removedistpublisherdbreplication
TSQL

sp_removedistpublisherdbreplication (Transact-SQL)

[!INCLUDE SQL Server SQL MI]

Removes publishing metadata belonging to a specific publication at the Distributor. This stored procedure is executed at the Distributor on the distribution database.

:::image type="icon" source="../../includes/media/topic-link-icon.svg" border="false"::: Transact-SQL syntax conventions

Syntax

sp_removedistpublisherdbreplication
    [ @publisher = ] N'publisher'
    , [ @publisher_db = ] N'publisher_db'
[ ; ]

Arguments

[ @publisher = ] N'publisher'

The name of the Publisher server. @publisher is sysname, with no default.

[ @publisher_db = ] N'publisher_db'

The name of the publication database. @publisher_db is sysname, with no default.

Return code values

0 (success) or 1 (failure).

Remarks

sp_removedistpublisherdbreplication is used by transactional and snapshot replication.

sp_removedistpublisherdbreplication is used when a published database must be recreated without also dropping the distribution database. The following metadata is removed:

  • All publication metadata.
  • Metadata for all articles belong to the publication.
  • Metadata for all subscriptions to the publication.
  • Metadata for all replication agent jobs that belong to the publication.

Permissions

Only members of the sysadmin fixed server role at the Distributor or members of the db_owner fixed database role in the distribution database can execute sp_removedistpublisherdbreplication.

Related content