先退出数据库,再次登录然后执行drop语句
use master
go
declare hcforeach cursor global for
select 'kill '+rtrim(spid)
from master.dbo.sysprocesses
where dbid=db_id(‘test’)
exec sp_msforeach_worker ‘?’
drop database test
go
先退出数据库,再次登录然后执行drop语句
use master
go
declare hcforeach cursor global for
select 'kill '+rtrim(spid)
from master.dbo.sysprocesses
where dbid=db_id(‘test’)
exec sp_msforeach_worker ‘?’
drop database test
go