Database is being used by another process … but what process?

后端 未结 10 1717

I have written a very small C# program, that uses a very small SQL Server database, purely for some learning & testing purposes. The database is used in this one new pro

10条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-06 00:32

    IIRC using AttachDbFilename spins up a SqlServr.exe process running under the user account your process is using, separate from the SqlServer instance running as a service (so stopping the MsSqlServer service doesn't stop this issue). In the case of a dirty exit, sometimes this process does not get cleaned up. I suspect that killing this process will free up the db files.

提交回复
热议问题