Thursday, October 1, 2015

SQL Server 2012: Execution Error: Restore of database failed


From within SQL Server Management Studio (SSMS), you attempt to restore a SharePoint Server 2013 database, but then experience this error message:
TITLE: Microsoft SQL Server Management Studio ------------------------------
 Restore of database 'YOURDATABASE' failed. (Microsoft.SqlServer.Management.RelationalEngineTasks) ------------------------------
ADDITIONAL INFORMATION: System.Data.SqlClient.SqlError: The operating system returned the error '32(The process cannot access the file because it is being used by another process.)' while attempting 'RestoreContainer::ValidateTargetForCreation' on 'D:\Program Files\Microsoft SQL Server\MSSQL11.CSSP\MSSQL\DATA\YOURDATABASE.mdf'. (Microsoft.SqlServer.SmoExtended) For help, click:
 This solution is simple.


  1. In SSMS, launch the Restore Database dialog, 
  2. Select Files, and then enable Relocate all files to folder.
  3. Click OK.


1 comment:

Family First said...

thanks a lot for saving my time