The process cannot access the file because it is being used by another process

前端 未结 10 1053
忘了有多久
忘了有多久 2020-11-30 09:38

I have a set of nightly reports.

Sometimes I get the exception:

The process cannot access the file because it is being used by another proce

10条回答
  •  一生所求
    2020-11-30 10:37

    I just had the same problem but in my case i was trying to delete a .mdf file in Visul Studio 2012. There wasn't much information on the error given to help me solve this and so i came here looking for help. Then i realized that even though its a similar problem, it was rather a different process i had to deal with.

    What i did was try to delete the .mdf file in windows explorer and then i gave me an error that SQL Server 2008 R2 was in fact holding on to the file even though i had the database deleted. Once i new that, all i had to do was shutdown SQL Server 2008 R2 and tried to delete the file again and it worked.

    If you need instructions on how to turn on and off SQL Server 2008 R2, see link below.

    Turn on and off SQL Server

提交回复
热议问题