Help and Support
 

powered byLive Search

PRB: Expired Subscription Cleanup Agent Fails if the First Published Database is Deleted

Article ID:296792
Last Review:October 16, 2003
Revision:3.2
This article was previously published under Q296792

SYMPTOMS

If the first database that is published is then unpublished and dropped, and there are databases that are published, the Expired Subscription Cleanup Agent fails and the following error message occurs:
Unable to connect to SQL Server '(local)'. The step failed.
The error is also reported in the SQLServerAgent error log:
[298] SQLServer Error: 4060, Cannot open database requested in login '%.*ls'. Login fails. [SQLSTATE 42000]
				

Back to the top

CAUSE

The Expired Subscription Cleanup job executes the sp_expired_subscription_cleanup stored procedure within the context of the first database that was published. The sp_expired_subscription_cleanup stored procedure tries to run under the context of the database that was dropped but the procedure fails.

Back to the top

WORKAROUND

To work around this problem, follow these steps:
1.Open the SQL Enterprise Manager, and then navigate to the server that has the failed job.
2.Open the Miscellaneous Agents folder under the Replication Monitor folder. In the details window right-click the Expired Subscription Cleanup Agent, and then click Agent Properties.
3.To open the edit job step window, click the Steps tab, and then double-click the Run agent step.
4.Under the database option, you will see the first database (in alphabetical order) to be the database context under which the agent executes the stored procedure.
5.Select an existing database (preferably choose the master), and then click OK.
6.Close all the open windows. Click OK, and then start the agent. The agent now runs successfully.

Back to the top


APPLIES TO
Microsoft SQL Server 2000 Standard Edition
Microsoft SQL Server 7.0 Standard Edition

Back to the top

Keywords: 
kbcodesnippet kbprb KB296792

Back to the top

Article Translations

 

Related Support Centers

Other Support Options

  • Need More Help?
    Contact a Support professional by E-mail, Online or Phone.
  • Customer Service
    For non-technical assistance with product purchases, subscriptions, online services, events, training courses, corporate sales, piracy issues, and more.
  • Newsgroups
    Pose a question to other users. Discussion groups and Forums about specific Microsoft products, technologies, and services.