This error can be solved by stopping MSSQLSERVER service form configuration Tool in Microsoft Sql Server as shown with diagram in the link below:
Solve Error The action can’t be completed because the file is open in SQL SERVER(MSSQLSERVER)

Some time while moving a database (.mdf) from one location to other location on hard disk drive you encounter with the error ‘The action can’t be completed because the file is open in SQL SERVER(MSSQLSERVER) ‘ as shown in the diagram below:
The action can’t be completed because the file is open in SQL SERVER
Steps to solve error ‘The action can’t be completed because the file is open in SQL SERVER’ as shown in below: Step 1: Click on Start Icon on the task bar . Select Microsoft SQL Server folder and then click on SQL Server Configuration Manager as shown in the picture below:
The action can’t be completed because the file is open in SQL SERVER

Step 2: SQL SERVER Configuration Manger window will open on the left side of this window select SQL Server Services . In SQL server services right click on the service SQL Server (MSSQLSERVER) and click on Stop as shown in the picture below:
The action can’t be completed because the file is open in SQL SERVER

Step 3: As the process will stop move the file from one location to other and then again start this process by right click on it. Email ThisBlogThis!Share to TwitterShare to Facebook