Transact-SQL Reference

sp_adddistributor

Creates an entry in the 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.

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 Agent Job is created that wakes up 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 N, password is reset to a random value. The password must be configured when the first remote distributor that is not trusted 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.

[@from_scripting = ] from_scripting

For internal use only.

Return Code Values

0 (success) or 1 (failure)

Remarks

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

Permissions

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

See Also

sp_changedistributor_property

sp_dropdistributor

sp_helpdistributor

System Stored Procedures