sp_changedistpublisher (Transact-SQL)

Applies to: SQL Server Azure SQL Managed Instance

Changes the properties of the distribution Publisher. This stored procedure is executed at the Distributor on any database.

Transact-SQL syntax conventions


sp_changedistpublisher [ @publisher = ] 'publisher'  
    [ , [ @property = ] 'property' ]  
    [ , [ @value = ] 'value' ]  


[ @publisher = ] 'publisher' Is the Publisher name. publisher is sysname, with no default.

[ @property = ] 'property' Is a property to change for the given Publisher. property is sysname and can be one of these values.

[ @value = ] 'value' Is the value for the given property. value is nvarchar(255), with a default of NULL.

Publisher and distributor databases on Azure SQL Database require Managed Instance for more information, see Replication with Azure SQL Database.

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 Use Windows Authentication when connecting to the Publisher. This cannot be changed for a non-Microsoft SQL Server publisher.
0 Use SQL Server Authentication when connecting to the Publisher. This can't be changed for a non-SQL Server 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.

Return Code Values

0 (success) or 1 (failure)


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 visa-versa.


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

See Also

View and Modify Distributor and Publisher Properties
sp_adddistpublisher (Transact-SQL)
sp_dropdistpublisher (Transact-SQL)
sp_helpdistpublisher (Transact-SQL)
System Stored Procedures (Transact-SQL)