CFF KB - Carrz-Fox-Fire Promotions Knowledge Base

CFF KB is all about 1 thing: The Sharing of Knowledge and the Power we gain from it.
  • Breadrumbs:
  • The operating system returned the error '5(Access is denied.)' while attempting 'RestoreContainer::ValidateTargetForCreation'

  • CFF Knowledge Base - Share With Facebook CFF Knowledge Base - Share on Twitter CFF Knowledge Base - Share on Reddit CFF Knowledge Base - Share on Digg It CFF Knowledge Base - Share on Stumble Upon It CFF Knowledge Base - Share on Delicious
    Share With Friends (Updated 6-8-2010)
  • Article ID:
    227
  • Date Created
    Monday, April 27, 2020
  • This Article Has been Viewed
    681 times
  • Short Desc
    You receive access is denied error when trying to restore a database in SQL Server Management Studio (SSMS).
  • Details
    When 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 Issue
    The folder(s) the database and log files are to be located in, 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...]
    Chose 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.