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
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 Restore Schedule

Author  Topic 

vdavid70
Yak Posting Veteran

67 Posts

Posted - 2005-08-25 : 07:31:12
Is it possible to schedule the restore of a database. I wrote a script to schedule a restore, specifying this code

EXEC sp_dboption 'nikutrain ', 'single user', TRUE to make it single user before the script executes. but this seems to be failing everytime it runs with an error saying
Server: Msg 5070, Level 16, State 2, Line 1
Database state cannot be changed while other users are using the database 'NikuTrain'

or Exclusive access cannot be obtained while other users are in the database.

Please how else can i archeive this scheduling.

Kristen
Test

22859 Posts

Posted - 2005-08-25 : 08:01:54
Use

ALTER DATABASE nikutrain SET SINGLE_USER WITH ROLLBACK IMMEDIATE

instead?

Kristen
Go to Top of Page

vdavid70
Yak Posting Veteran

67 Posts

Posted - 2005-08-25 : 09:01:22
Used that as well but doesn't seem to be working
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2005-08-25 : 10:30:33
Are you connected to the database you are trying to restore to? Maybe do

USE MASTER

first

Kristen
Go to Top of Page
   

- Advertisement -