Skip to content

Latest commit

 

History

History
74 lines (57 loc) · 4.52 KB

File metadata and controls

74 lines (57 loc) · 4.52 KB
title sp_adddistributor (Transact-SQL) | Microsoft Docs
ms.custom
ms.date 03/06/2017
ms.prod sql
ms.prod_service database-engine
ms.reviewer
ms.technology replication
ms.topic language-reference
f1_keywords
sp_adddistributor
sp_adddistributor_TSQL
dev_langs
TSQL
helpviewer_keywords
sp_adddistributor
ms.assetid 35415502-68d0-40f6-993c-180e50004f1e
author mashamsft
ms.author mathoma

sp_adddistributor (Transact-SQL)

[!INCLUDEappliesto-ss-asdbmi-xxxx-xxx-md]

Creates an entry in the sys.sysservers table (if there is not one), marks the server entry as a Distributor, and stores property information. This stored procedure is executed at the Distributor on the master database to register and mark the server as a distributor. In the case of a remote distributor, it is also executed at the Publisher from the master database to register the remote distributor.

Topic link icon Transact-SQL Syntax Conventions

Syntax

  
sp_adddistributor [ @distributor= ] 'distributor'   
    [ , [ @heartbeat_interval= ] heartbeat_interval ]   
    [ , [ @password= ] 'password' ]   
    [ , [ @from_scripting= ] from_scripting ]  

Arguments

[ @distributor = ] 'distributor' Is the distribution server name. distributor is sysname, with no default. This parameter is only used if setting up a remote Distributor. It adds entries for the Distributor properties in the msdb..MSdistributor table.

[ @heartbeat_interval = ] heartbeat_interval Is the maximum number of minutes that an agent can go without logging a progress message. heartbeat_interval is int, with a default of 10 minutes. A SQL Server Agent job is created that runs on this interval to check the status of the replication agents that are running.

[ @password = ] 'password'] Is the password of the distributor_admin login. password is sysname, with a default of NULL. If NULL or an empty string, password is reset to a random value. The password must be configured when the first remote distributor is added. distributor_admin login and password are stored for linked server entry used for a distributor RPC connection, including local connections. If distributor is local, the password for distributor_admin is set to a new value. For Publishers with a remote Distributor, the same value for password must be specified when executing sp_adddistributor at both the Publisher and Distributor. sp_changedistributor_password can be used to change the Distributor password.

Important

When possible, prompt users to enter security credentials at runtime. If you must store credentials in a script file, you must secure the file to prevent unauthorized access.

[ @from_scripting = ] from_scripting [!INCLUDEssInternalOnly]

Return Code Values

0 (success) or 1 (failure)

Remarks

sp_adddistributor is used in snapshot replication, transactional replication, and merge replication.

Example

[!code-sqlHowTo#AddDistPub]

Permissions

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

See Also

Configure Publishing and Distribution
sp_changedistributor_property (Transact-SQL)
sp_dropdistributor (Transact-SQL)
sp_helpdistributor (Transact-SQL)
System Stored Procedures (Transact-SQL)
Configure Distribution