ERROR MESAGGE:
CREATE FILE encountered operating system error 32(The process cannot access the file because it is being used by another process.) while attempting to open or create the physical file
EXPLANATION:
You may receive this error in the following cases.:
- When you want to attach the database files to an instance
- When you want to restore the database to an instance
- If Instance cannot create tempdb files while opening.
SOLUTION:
- Make sure that the database files that you are trying to attach to your SQL Server Instance is not being used by another SQL Server Instance.
- Make sure that the database that you are trying to restore to your SQL Server Instance is not being used by another SQL Server Instance.
- Make sure that there are no tempdb files of another instnce on the path where tempdb will be created.