Microsoft KB Archive/312106

= PRB: Distribution Agent Fails After You Apply Replication Scripts =

Article ID: 312106

Article Last Modified on 10/3/2003

-

APPLIES TO


 * Microsoft SQL Server 2000 Standard Edition

-



This article was previously published under Q312106



SYMPTOMS
After you apply a SQL Server replication script that was generated from an existing replication setup, the Distribution Agent cannot connect to the Subscriber. The Distribution Agent indicates the following error message in Enterprise Manager:

The process could not connect to subscriber.

If you view the Agent History Details you may see the following error message: Error Message:

The process could not connect to Subscriber

Error Details:

Login failed for user 'sa'. (Source: (Data source); Error number: 18456)



CAUSE
For security reasons, the SQL Server Replication Script Wizard does not write the passwords for SQL logins to the save script, which includes the login information for the distributor and subscribers.



WORKAROUND
When you use Microsoft Windows NT authentication, passwords are not needed and therefore @password = N'' is not included in the SQL scripts.

Before you run a Replication script, edit the Replication script to include the passwords for the distributor and the subscriber logins. Search for &quot;@password =&quot; and then edit the N'' to include the proper password.

For example, change:

@password = N''

-to-

@password = N'mypassword'

NOTE: The user name in the example script is &quot;sa&quot;; however, in your script you may use other SQL Server logins.

Sample Replication Script
/****** Begin: Script to be run at Distributor: SKOR ******/ /****** Installing the server SKOR as a Distributor. Script Date: 11/5/2001 4:58:00 PM ******/ use master GO

exec sp_adddistributor @distributor = N'SKOR', @password = N''

/****** Begin: Script to be run at Publisher: SKOR ******/ -- Adding the registered subscriber exec sp_addsubscriber @subscriber = N'MYSUBSCRIBER', @type = 0, @login = N'sa', @password = N'', @security_mode = 0,

Keywords: kbprb KB312106

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.