Knowledgebase
Restore failed for Server 'server\sqlexpress'. (Microsoft.SqlServer.Express.Smo)
Posted by on 18 August 2012 02:30 AM

You receieve an error when you restore a SQL Server database from a Database Backup file (databasename.bak).

 

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\databasename.mdf'. (Microsoft.SqlServer.Express.Smo)

 

Note: databasename.mdf is the actual name of your database.

 

SQL Server is trying to restore the database to '...\MSSQL\databasename.mdf'.'

 

Change the destination folder to '...\MSSQL\Data\databasename.mdf

(10 vote(s))
Helpful
Not helpful

Comments (0)
Post a new comment
 
 
Full Name:
Email:
Comments:
CAPTCHA Verification 
 
Please enter the text you see in the image into the textbox below (we use this to prevent automated submissions).