1

When I try to restore a database backup file, I get the following error:

An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)

Additional information:

Cannot open backup device 'C:\Domains\Backup.bak'. Operating system error 5(Access is denied.).

RESTORE HEADERONLY is terminating abnormally. (Microsoft SQL Server, Error: 3201)

This only happens on our remote machine. The backup file restores fine locally. The user has administrative privileges on the remote machine and the network service has access to the database and backup file. What is the problem here?

3 Answers 3

2

The SQL user needs the rights to access that location. Network service and local user are not used by SQL anymore.

2
  • how to give rights to access that location to the sql server? Jun 20, 2017 at 12:18
  • Exactly what rights are needed? Having the same trouble and giving access to the computer name, as per this. Giving read or read-write access doesn't seem to matter. I do see the account gets access granted in EventLog. Also the backup file's read-only attribute is not set.
    – Anttu
    Mar 23, 2020 at 10:09
1

While installing sql server if u have selected network services then you will have to add network service in services.msc. select sql server (mssqlserver) and then click properties and then log on. Here specify the account you have used while installing sql server and I hope your problem will be solved. Still if it not solved then you can get in touch with me at gauravj.iitkgp@gmail.com

0

Is this using 2008/2008r2/win7/vista? If so, Adminsitrator users aren't administrators... until after UAC has it's say-so. You could try running the restore process with the application running in "Administrator Mode" (right-click run as administrator)... and see if that helps.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.