locked
SQL Server Express error: 5 Access Denied RRS feed

  • Question

  • After installing SQL Server express to my WinXP machine, when I attempt to restore a database from a 2000 backup, I get the following error:

     

    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\MSSQL.1\MSSQL\TEST.MDF'. (Microsoft.SqlServer.Express.Smo)

     

    Any ideas?

    Thursday, February 22, 2007 11:17 PM

Answers

  • Hi,

    the original file location is stored in the backup, if you do not want to deploy the files on the same relative location on the traget server, you will either have to make sure that the path exists OR you use the WITH MOVE option to place the MDF/LDF files on a different location.

    HTH, Jens K. Suessmeyer.

    ---
    http://www.sqlserver2005.de
    ---
    Friday, February 23, 2007 8:55 AM

All replies

  • Hi,

    the original file location is stored in the backup, if you do not want to deploy the files on the same relative location on the traget server, you will either have to make sure that the path exists OR you use the WITH MOVE option to place the MDF/LDF files on a different location.

    HTH, Jens K. Suessmeyer.

    ---
    http://www.sqlserver2005.de
    ---
    Friday, February 23, 2007 8:55 AM
  • Long time i was struggling with this error ..... and finally i found a simple way to clear this problem

     

    In the restore Database window change the Restore the database file as to a new location by clicking the browse button.

     

     now give a different location to save the mdf and ldf file!

     

    G.Stanley John.

     

    Radius Consultancy Promotion pvt Ltd.

    Chennai.

    Monday, February 11, 2008 10:28 AM
  •  

    I had this problem and found the solution setting the Permissions to both:

    C:\Program Files\Microsoft SQL Server\MSSQL.1

    C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data

     

    For my SQL User Accounts on my machine to allow them to write the MDF and LDF Files to those locations. 

     

    Saturday, March 8, 2008 4:03 PM