sp_changedistributor_password (Transact-SQL)

適用於:SQL ServerAzure SQL 受控執行個體

變更散發者的密碼。 此預存程式會在任何資料庫的散發者端執行。 如果這是遠端散發者,則必須在使用此散發者的所有發行者伺服器上執行。 如果散發或發行者資料庫位於可用性群組中,則必須在所有散發者和發行者節點上執行。 節點是主要或次要節點並不重要。

Transact-SQL 語法慣例

語法

sp_changedistributor_password [ @password = ] 'password'
[ ; ]

引數

[ @password = ] 'password'

新密碼 @password為 sysname,沒有預設值。 如果散發者是本機,系統登入的密碼 distributor_admin 就會變更。

傳回碼值

0 (成功)或 1 (失敗)。

備註

sp_changedistributor_password 用於所有類型的複寫。

範例

-- 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;
GO

DECLARE @password NVARCHAR(50) = "YourLongP@$$w0rdHere";

EXEC sp_changedistributor_password @password;
GO

權限

只有系統管理員固定伺服器角色的成員才能執行 sp_changedistributor_password

另請參閱