Skip to content

Latest commit

 

History

History
85 lines (58 loc) · 3.62 KB

sp-dropdistpublisher-transact-sql.md

File metadata and controls

85 lines (58 loc) · 3.62 KB
title description author ms.author ms.reviewer ms.date ms.service ms.subservice ms.topic f1_keywords helpviewer_keywords dev_langs
sp_dropdistpublisher (Transact-SQL)
Drops a distribution Publisher. This stored procedure is executed at the Distributor on any database.
markingmyname
maghan
randolphwest
11/28/2023
sql
replication
reference
sp_dropdistpublisher
sp_dropdistpublisher_TSQL
sp_dropdistpublisher
TSQL

sp_dropdistpublisher (Transact-SQL)

[!INCLUDE SQL Server SQL MI]

Drops a distribution Publisher. This stored procedure is executed at the Distributor on any database.

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

Syntax

sp_dropdistpublisher
    [ @publisher = ] N'publisher'
    [ , [ @no_checks = ] no_checks ]
    [ , [ @ignore_distributor = ] ignore_distributor ]
[ ; ]

Arguments

[ @publisher = ] N'publisher'

The Publisher to drop. @publisher is sysname, with no default.

Note

Using a custom port for the [!INCLUDE ssnoversion-md] publisher was introduced in [!INCLUDE sssql19-md]. If the [!INCLUDE ssnoversion-md] publisher is configured with a custom port, then when dropping such a publisher on the distributor, supply the publisher server name instead of <Hostname>,<PortNumber>.

[ @no_checks = ] no_checks

Specifies whether sp_dropdistpublisher checks that the Publisher has uninstalled the server as the Distributor. @no_checks is bit, with a default of 0.

  • If 0, replication verifies that the remote Publisher has uninstalled the local server as the Distributor. If the Publisher is local, replication verifies that there are no publication or distribution objects remaining on the local server.

  • If 1, all the replication objects associated with the distribution Publisher are dropped even if a remote Publisher can't be reached. After doing this, the remote Publisher must uninstall replication using sp_dropdistributor with @ignore_distributor = 1.

[ @ignore_distributor = ] ignore_distributor

Specifies whether distribution objects are left at the Distributor when the Publisher is removed. @ignore_distributor is bit, and can be one of these values:

  • 1 = distribution objects belonging to the @publisher remain at the Distributor.
  • 0 = distribution objects for the @publisher are cleaned-up at the Distributor.

Return code values

0 (success) or 1 (failure).

Remarks

sp_dropdistpublisher is used in all types of replication.

When dropping an Oracle Publisher, if unable to drop the Publisher, sp_dropdistpublisher returns an error and the Distributor objects for the Publisher are removed.

Examples

:::code language="sql" source="../replication/codesnippet/tsql/sp-dropdistpublisher-tra_1.sql":::

Permissions

Only members of the sysadmin fixed server role can execute sp_dropdistpublisher.

Related content