產(chǎn)品手冊 實施方案 用戶案例 問題中心

          解除某一個數(shù)據(jù)庫被應(yīng)用程序占用的情況

          —— 解除數(shù)據(jù)庫占用
          use master
          go

          declare @dbname sysname
          set @dbname=’OIMobox’ –不能刪除,或不能 還原的數(shù)據(jù)庫

          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)簽:手冊方案 上一篇:
          展開更多
          預(yù)約軟件體驗

          loading...