—— 解除數(shù)據(jù)庫(kù)占用
use master
go
declare @dbname sysname
set @dbname=’OIMobox’ –不能刪除,或不能 還原的數(shù)據(jù)庫(kù)
declare @s nvarchar(1000)
declare tb cursor local for
select s=’kill ‘+cast(spid as varchar)
from master..sysprocesses
where dbid=db_id(@dbname)
open tb
fetch next from tb into @s
while @@fetch_status=0
begin
exec(@s)
fetch next from tb into @s
end
close tb
deallocate tb
標(biāo)簽:手冊(cè)方案
上一篇: 傳統(tǒng)企業(yè)合同檔案如何管理存檔