Thursday 23 January 2014

Mini Post: Restore of Database Failed; Access is Denied

Happy New Year! (Albeit a little late!)

Welcome back to SQL Something!

To start off the year we'll look at a very small issue: "The operating system returned the error '5(Access is denied)' while attempting restore".


Fig. 1: Access is Denied

A couple reasons could cause this, the answer to some of which is found in the actual error text:

  • The directory does not exist. Solution: Verify path.
  • Directory exists but current user does not have relevant folder privileges. Solution: Add relevant privileges to the current SQL Server Service user.
  • MDF/LDF files of the same name already exists. Solution: Select "WITH REPLACE" option in "Options" tab in DB restore screen (see Fig. 2).

Fig. 2: Choosing the WITH REPLACE option on the 'Options' tab.

No comments:

Post a Comment