mssql2005数据库备份在sql2000数据库中恢复
Http://www.Egocbd.com 点击数: 更新时间:2010-3-11 14:35:06
进程处理
if @overexist=1 and @killuser=1
begin
declare @spid varchar(20)
declare #spid cursor for
select spid=cast(spid as varchar(20)) from master..sysprocesses where dbid=db_id(@dbname)
open #spid
fetch next from #spid into @spid
while @@fetch_status=0
begin
exec(’kill ’+@spid)
fetch next from #spid into @spid
end
close #spid
deallocate #spid
end
--恢复数据库
exec(@sql)
go
if @overexist=1 and @killuser=1
begin
declare @spid varchar(20)
declare #spid cursor for
select spid=cast(spid as varchar(20)) from master..sysprocesses where dbid=db_id(@dbname)
open #spid
fetch next from #spid into @spid
while @@fetch_status=0
begin
exec(’kill ’+@spid)
fetch next from #spid into @spid
end
close #spid
deallocate #spid
end
--恢复数据库
exec(@sql)
go
上一篇:什么样的网站要申请办理 ICP...下一篇:极通EWEBS安装与配置