“The process cannot access the file because it is being used by another process” when trying to copy a Database

I am trying to make a copy of a SQL Database from a Command Prompt using the following command:

C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA>copy CM_PRI
*.* CM_ZZZ*.*

but when the command runs I get the following errors:

CM_PRI.mdf
The process cannot access the file because it is being used by another process.
CM_PRI_log.ldf
The process cannot access the file because it is being used by another process.
0 file(s) copied.

You need a subscription to access the answer.


This content is restricted to subscribers

Login to leave your feedback!

Leave a Reply