0

When I tried to restore a backup an error occurred showing access denied. The error message is as follows:

Restore failed for Server 'VAIO\sqlexpress'. (Microsoft.SqlServer.SmoExtended)

System.Data.SqlClient.SqlError: The operating system returned the error '5(Access is denied.)' while attempting 'RestoreContainer::ValidateTargetForCreation' on 'C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA\ihrd_mvk_newspaperboy.mdf'. (Microsoft.SqlServer.Smo).

  • 2
    Possible duplicate of mssql 5(Access is denied.) error during restoring database – MegaTron Aug 20 '15 at 17:32
  • This can possibly answer your question: stackoverflow.com/questions/7031792/… – SQLStad Aug 20 '15 at 20:16
  • How are you restoring - SSMS GUI, TSQL, cmd line? Do you have access to all of the drives where you are restoring files? What kind of access do you have? – Steve Mangiameli Aug 20 '15 at 22:40
  • Two things. Close SSMS and launch it again as Administrator an make sure SQL Server service account has read write privilege on folder and subfolders C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA\ihrd_mvk_newspaperboy.mdf' – Shanky Aug 21 '15 at 4:29
-1

Open "SQL Server Configuration manager"=>set "SQL Server" logon as=>Local System.

| improve this answer | |
  • Welcome to the site! Thank you for taking the time to answer. Please could you expand on your answer to include details as to what you think is causing the problem in the question and why you think your solution would work. This will help improve the quality of your answer. – World Wide DBA Jul 19 at 18:17

Your Answer

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