KB IssueYou receive an "Access is denied error", when trying to restore a database in SQL Server Management Studio
(SSMS).
Issue DetailsWhen trying to restore a database in SQL Server Management Studio (SSMS), you may encounter the following error. The operating system returned the error 5(Access is denied.) while attempting
RestoreContainer::ValidateTargetForCreation
Recreate IssueThe folder(s) where the database and log files are to be located need to have the proper permissions granted for SQL Server to write information to the folder(s).
Resolve Issue- Navigate to [Control Panel]
- Chose [Administrative Tools]
- Open [Services]
- Scroll down and open [SQL Server (InstanceName)]
- Choose the [Log On] tab
- Copy the [This account] name (Example: NT Service\MSSQL$InstanceName)
Navigate to the folder where you will be storing your database and log files- Right-click, and choose [Porperties]
- Select the [Security] tab
- Click [Edit]
- Click [Add]
The following only applies if you are on a domain- Click [Locations...]
- Choose the Computer name at the top
Click [OK] This section applies to all- Paste the account you copied from earlier
NT Service\MSSQL$InstanceName - Click [OK] on all windows.
Now, inside of SSMS, perform the Restore.