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).

migrated from stackoverflow.com Aug 20 '15 at 20:14

This question came from our site for professional and enthusiast programmers.

  • 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

Your Answer

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