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.
| 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 codeEXEC 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 sayingServer: Msg 5070, Level 16, State 2, Line 1Database 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
|
| UseALTER DATABASE nikutrain SET SINGLE_USER WITH ROLLBACK IMMEDIATEinstead?Kristen |
 |
|
|
vdavid70
Yak Posting Veteran
67 Posts |
Posted - 2005-08-25 : 09:01:22
|
| Used that as well but doesn't seem to be working |
 |
|
|
Kristen
Test
22859 Posts |
Posted - 2005-08-25 : 10:30:33
|
| Are you connected to the database you are trying to restore to? Maybe doUSE MASTERfirstKristen |
 |
|
|
|
|
|