我是这样备份的(backup database schoolmanage to disk 'c:\\schoolmanage' with INIT)
然后这样恢复的(restore database schoolmanage from disk='c:\\schoolmanage'
备份没有问题,但是恢复就出错.提示如下:'数据库正在使用,所以未能获得对数据库的排它性访问权'
请问怎样做这个恢复数据库?
然后这样恢复的(restore database schoolmanage from disk='c:\\schoolmanage'
备份没有问题,但是恢复就出错.提示如下:'数据库正在使用,所以未能获得对数据库的排它性访问权'
请问怎样做这个恢复数据库?
use pubs --随便打开个其他库
restore database schoolmanage from disk='c:\\schoolmanage'
你可以找找简单思路就是declare cursor1 cursor for select spid from master..sysprocesses
where spid > 50 --用户spidopen ---while @@fetch_status = 0
begin
exec('kill ' + cast(@spid as varchar(20)))
fetch next from cursor1 into @spid
endcolse ..
deallocate ..
详细的你去找老大的程序
;)
2.USE MASTER
Exec KillSpid--存储过程
Restore Database XXX From Disk='XXX'