sp_changedistributor_password (Transact-SQL)

THIS TOPIC APPLIES TO:yesSQL Server (starting with 2008)noAzure SQL DatabasenoAzure SQL Data Warehouse noParallel Data Warehouse

Changes the password for a Distributor. This stored procedure is executed at the Distributor on any database.

Topic link icon Transact-SQL Syntax Conventions

Syntax


sp_changedistributor_password [ @password= ] 'password'   

Arguments

[ @password=] 'password'
Is the new password. password is sysname, with no default. If the Distributor is local, the password of the distributor_admin system login is changed.

Return Code Values

0 (success) or 1 (failure)

Remarks

sp_changedistributor_password is used in all types of replication.

Example

-- Change the password on the Distributor. 
-- To avoid storing the password in the script file, the value is passed 
-- into SQLCMD as a scripting variable. For information about how to use 
-- scripting variables on the command line and in SQL Server Management
-- Studio, see the "Executing Replication Scripts" section in the topic
-- "Programming Replication Using System Stored Procedures".
USE master
EXEC sp_changedistributor_password $(Password)
GO

Permissions

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

See Also

View and Modify Replication Security Settings
Secure the Distributor
sp_adddistributor (Transact-SQL)
Replication Stored Procedures (Transact-SQL)