• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 215
  • Last Modified:

SQL database backup success but - causing connection errors for scheduled tasks

Hi there,

I have an sql server which runs its database backups at 22:00.

At this time we have a number of scheduled tasks which connect to the database and extract some information.

The backups run perfectly but the scheduled tasks intermittently fail with sql connection errors.

If we change the scheduled tasks to run an hour before they work perfectly so its defintly the backups causing issues.

What can i check to resolve?
  • 2
1 Solution
dsackerContract ERP Admin/ConsultantCommented:
Do these scheduled tasks run via the OS Task Scheduler? (From your statement that they "connect to the database", it sounds like they do.)

If so, you can actually trigger them off the completion of a SQL Maintenance Plan (if that's how you run your backups).

For instance, when a Maintenance Plan completes, it will log an event to the application event . If you look for source SQLISPackage100, Event ID 12289 (could differ a little bit, you'll have to play with this), your OS Task could fire from this trigger.

If these are all run within SQL Agent (as jobs), you may have to consider adding a sp_start_job 'Some Next Job' in your last step of the backup.

This is one of a number of articles on sp_start_job. I also wrote a blog sometime back on Scheduling OS Tasks to run after a maintenance plan finishes.
Spikeuk30Author Commented:

Yes OS Task Scheduler.

This runs an exe which is configured to connect to the db pull some information and email it.

Probably a silly question   -  Why will it not work during the maintenance plan?  

Is the db avalible to website users while the paln is running?
dsackerContract ERP Admin/ConsultantCommented:
Depend on where the backup is at. Sounds like you possibly hit a deadlock.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Train for your Pen Testing Engineer Certification

Enroll today in this bundle of courses to gain experience in the logistics of pen testing, Linux fundamentals, vulnerability assessments, detecting live systems, and more! This series, valued at $3,000, is free for Premium members, Team Accounts, and Qualified Experts.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now