Skip to content

Latest commit

 

History

History
90 lines (65 loc) · 3.52 KB

sp-changedistpublisher-transact-sql.md

File metadata and controls

90 lines (65 loc) · 3.52 KB
title description author ms.author ms.reviewer ms.date ms.service ms.subservice ms.topic f1_keywords helpviewer_keywords dev_langs
sp_changedistpublisher (Transact-SQL)
Changes the properties of the distribution Publisher.
markingmyname
maghan
randolphwest
08/21/2024
sql
replication
reference
sp_changedistpublisher_TSQL
sp_changedistpublisher
sp_changedistpublisher
TSQL

sp_changedistpublisher (Transact-SQL)

[!INCLUDE SQL Server SQL MI]

Changes the properties of the 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_changedistpublisher
    [ @publisher = ] N'publisher'
    [ , [ @property = ] N'property' ]
    [ , [ @value = ] N'value' ]
[ ; ]

Arguments

[ @publisher = ] N'publisher'

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

[ @property = ] N'property'

A property to change for the given Publisher. @property is sysname, and can be one of the properties in the table listed under @value.

[ @value = ] N'value'

The value for the given property. @value is nvarchar(255), and can be one of the values in the following table.

[!INCLUDE Azure SQL Database link]

This table describes the properties of Publishers and the values for those properties.

Property Values Description
active true Activates the Publisher.
false Deactivates the publisher
distribution_db Name of the distribution database.
login Login name.
password Strong password for the supplied login.
security_mode 1 1 Use Windows Authentication when connecting to the Publisher.
0 Use [!INCLUDE ssNoVersion] Authentication when connecting to the Publisher.
working_directory Working directory used to store data and schema files for the publication.
NULL (default) All available property options are printed.
storage_connection_string Access key The access key for the working directory when the database is Azure SQL Managed Instance.

1 This can't be changed for a non-[!INCLUDE ssNoVersion] publisher.

Return code values

0 (success) or 1 (failure).

Remarks

sp_changedistpublisher is used in all types of replication.

If you're changing the working_directory property and the storage_connection_string property has to be updated, execute the stored procedure separately by updating the working_directory property, followed by updating the storage_connection_string property, or vice-versa.

Permissions

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

Related content