Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 665605
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T23:43:36+00:00 2026-05-13T23:43:36+00:00

I have a stored procedure that runs custom backups for around 60 SQL servers

  • 0

I have a stored procedure that runs custom backups for around 60 SQL servers (mixes 2000 through 2008R2).

Occasionally, due to issues outside of my control (backup device inaccessible, network error, etc.) an individual backup on one or two databases will fail. This causes this entire step to fail, which means any subsequent backup commands are not executed and half of the databases on a given server may not be backed up.

On the 2005+ boxes I am using TRY/CATCH blocks to manage these problems and continue backing up the remaining databases. On a 2000 server however, for example, I have no way to prevent this error from failing the entire step:

Msg 3201, Level 16, State 1, Line 1 Cannot open backup device ‘db-diff(\PATH\DB-DIFF-03-16-2010.DIF)’. Operating system error 5(Access is denied.). Msg 3013, Level 16, State 1, Line 1 BACKUP DATABASE is terminating abnormally.

I am simply asking if anything like TRY/CATCH is possible in SQL 2000? I realize there are no built in methods for this, so I guess I am looking for some creativity.

Even when wrapping each backup (or any failing statement) via sp_executesql the job fails instantly. Example:

DECLARE @x       INT,
        @iReturn INT

PRINT 'Executing statement that will fail with 208.'
EXEC @iReturn = Sp_executesql N'SELECT * from TABLETHATDOESNTEXIST;'
PRINT Cast(@iReturn AS NVARCHAR) --In SSMS this return code prints. Executed as a job it fails and aborts before this statement.
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T23:43:36+00:00Added an answer on May 13, 2026 at 11:43 pm

    Short answer: No.

    Is there anything else you can do to try to preemptively avoid the the error? Check for connections/transactions etc. Do you know why it’s considered Access is Denied (I’m assuming it’s “in use”).

    Can the base proc be split into multiple segments of 1 per db? i.e. same proc called multiple times via a batch file or other root file?

    Can you move it up a level to shell the call in another managing app or layer?

    Would it be better to use a 3rd party tool like RedGates SQL Backup? The upfront expense of such a tool may more than save the cost support over time.
    http://www.red-gate.com/products/SQL_Backup/index.htm

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an app that runs a stored procedure in SQL Server, checking the
My limited SQL knowledge prompted this post! I have a stored procedure that runs
The problem is I have a stored procedure that runs consistently in Sql Server
I have a script that runs a stored procedure in my SQL server database,
We have the following simple Stored Procedure that runs as an overnight SQL server
I have a SQL Server 2008 R2 stored procedure that runs a few INSERTs
I have a sql stored procedure that runs for about 3 minutes, I am
I have a stored procedure that has this line: SET @SQL = 'SELECT path,title,tags
I have a large auditing stored procedure that prints values and runs some SELECT
I have a SqlCommand which runs a stored procedure that contains two integer output

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.