sp_adddistpublisher (T-SQL)

Creates a remote Publisher that uses the local Distributor.

Syntax

sp_adddistpublisher [@publisher =] 'publisher',
    
[@distribution_db =] 'distribution_db'
    
[,[@security_mode =] security_mode]
    [,[@login =] 'login'] [,[@password =] 'password']
    
{,[@working_directory =] 'working_directory'},
    [,[@trusted =] 'trusted'] [,[@encrypted_password =] encrypted_password]
    [,[@thirdparty_flag =] thirdparty_flag

Arguments
[@publisher =] 'publisher'
Is the Publisher name. publisher is sysname, with no default.
[@distribution_db =] 'distribution_db'
Is the name of the distribution database. distributor_db is sysname, with no default. This parameter is used by replication agents to connect to the Publisher.
[@security_mode =] security_mode
Is the implemented security mode. security_mode is int, and can be one of these values.

 

Value Description
0 SQL Server Authentication security. Used when Distributor is running on Microsoft Windows® 95.
1 Windows NT Authentication security. Used when Distributor is running on Microsoft® Windows NT®.
NULL (default) Set to 0 or 1 according to the platform used.

 

This parameter is used by replication agents to connect to the Publisher.

[@login =] 'login'
Is the login. This parameter is required if security_mode is 0. login is sysname, with a default of sa. This parameter is used by replication agents to connect to the Publisher.
[@password =] 'password']
Is the password. password is sysname, with a default of NULL. This parameter is used by replication agents to connect to the Publisher.
[@working_directory =] 'working_directory'
Is the name of the working directory used to store data and schema files for the publication. working_directory is nvarchar(255). The name should be specified in UNC format.
[@trusted =] 'trusted'
Is whether the remote Publisher uses the same password as the local Distributor. trusted is nvarchar(5), and can be one of these values.

 

Value Description
true One trusted login mapping is added: sa to distributor_admin. Because the mapping is trusted, no password is needed at the remote Publisher to connect to the Distributor. SQL Server 6.x Publishers should be created as trusted.
false One nontrusted mapping is added, distributor_admin to distributor_admin. A password is needed at the remote Publisher to make a connection.
NULL (default) If the distribution Publisher is local, the default is nontrusted. Any password set for the Distributor is also set for the local distribution Publisher (linked server connection back to local Distributor). If the distribution Publisher is remote, the default is trusted and no password is needed at the remote Publisher. If the user directly changes the distributor_admin password instead of using sp_changedistributor_password, the local link is broken.

[@encrypted_password =] encrypted_password
Is whether the password is encrypted. encrypted_password is bit, with a default of 0. If 1, password is stored in encrypted form.
[@thirdparty_flag =] thirdparty_flag
Is whether the publication is a Microsoft SQL Server database. thirdparty_flag is bit, and can be one of these values.

 

Value Description
0 (default) Microsoft SQL Server
1 Data source other than Microsoft SQL Server

Return Code Values

0 (success) or 1 (failure)

Remarks

sp_adddistpublisher is used by snapshot, transactional, and merge replication.

Permissions

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

See Also
sp_changedistpublisher sp_helpdistpublisher
sp_dropdistpublisher System Stored Procedures

  


(c) 1988-98 Microsoft Corporation. All Rights Reserved.