[SQL] Kill process-the database is being used by some process

This problem is because the database is being used or called by some processes, you can use the following sql command in the new query to view the corresponding spid, the following aa is the name of the database we are operating

use master
go
select b.spid from sysdatabases a ,sysprocesses b where a.dbid=b.dbid and a.name=’aa’

Guess you like

Origin blog.csdn.net/badxcat/article/details/114239141
Recommended