Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 RESTORING..... freeze

Author  Topic 

nguyenl
Posting Yak Master

128 Posts

Posted - 2009-03-10 : 19:34:52
Hi,

I ran this script:


use master
Create table refresh (dir varchar(2000))
insert into refresh exec master.dbo.xp_cmdshell
'dir F:\INFO_PROP\INFO_PROP_backup_*.bak/b'
declare @filename varchar(500)
Select @filename = max(dir) from refresh where dir like 'INFO_PROP_backup_%.bak'
Select backup_file = @filename
Drop table Refresh
Set @filename = 'F:\INFO_PROP\' + @filename
RESTORE database INFO_TEST
from disk = @filename
WITH RECOVERY;

I found out thatwhen this script starts and breaks rightaway, the database becomes inaccessible. Right next to the database would be the word (restoring....). I can't cancel the restore. How can I prevent this from happening. When it breaks in the middle of the restore, I would like it to roll-back. Can this be done?

Thanks

guptam
Posting Yak Master

161 Posts

Posted - 2009-03-10 : 20:08:59
No.

Once a restore starts it will keep processing until complete. What do you mean by break? After you submit a batch to SQL Server it is executing it, until you close the session; long as you don't close session it will keep executing until batch a) completed b) errors out.

So are you getting an error if not, then please wait your restore probably is still going.

--
Mohit K. Gupta
B.Sc. CS, Minor Japanese
MCITP: Database Administrator
MCTS: SQL Server 2005
http://sqllearnings.blogspot.com/
Go to Top of Page
   

- Advertisement -