主题:[讨论]急救!!!请问HIBERNATE中怎么还原SQL数据库
急救!!!请问HIBERNATE中怎么还原SQL数据库。
不知道为什么我在HIBERNATE中操作还原数据库始终报告有连接未关闭
可是我应该已经用以下方法把数据库的所有连接都关闭了。
那位大虾知道请帮忙。小弟跪求!!
use master
go
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[p_killspid]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[p_killspid]
GO
create proc p_killspid
@dbname sysname --要关闭进程的数据库名
as
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
go
不知道为什么我在HIBERNATE中操作还原数据库始终报告有连接未关闭
可是我应该已经用以下方法把数据库的所有连接都关闭了。
那位大虾知道请帮忙。小弟跪求!!
use master
go
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[p_killspid]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[p_killspid]
GO
create proc p_killspid
@dbname sysname --要关闭进程的数据库名
as
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
go