SQL Server 2005, "5(Access Denied)" Error
- November 20, 2009 8:44 AM
- Microsoft Tools
- Comments (0)
I got the following error this morning trying to restore a SQL Server backup file:
Additional information: 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.2\MSSQL\[my database name].mdf'. (Microsoft.SqlServer.Express.Smo)
And a little bit of Googling brought me to a page which set me straight; it turns out SQL Server was trying to put the files into the wrong directory. You can read more about it here, in the original post where I found the info.