just in case anyone needs to do it
the script below called from OSQL in a batch file will restore a database
automatically, it needs to be detached and attached to clear connections
(unless anyone has any better ideas) cause any connections stops the restore
working, ba
dbcc detachdb ('su')
go
sp_Attach_DB 'su', 'd:\mssql7\data\su.mdf'
go
restore database SU from disk=N'e:\newecg\su_db_200303051621.bak'
-----Original Message-----
From: Robertson-Ravo, Neil (RX)
[mailto:[EMAIL PROTECTED]
Sent: 05 March 2003 11:09
To: '[EMAIL PROTECTED]'
Subject: RE: [ cf-dev ] OT: SQL Server Restore
well, you should be OK as long as you are backing up your Master DB daily.
-----Original Message-----
From: Mark Smyth [mailto:[EMAIL PROTECTED]
Sent: 05 March 2003 11:11
To: '[EMAIL PROTECTED]'
Subject: RE: [ cf-dev ] OT: SQL Server Restore
>>You certainly can restore a DB using a scheduled task;
from the enterprise manager?
>>the script you have
>>below is restoring the master database from a tape (DO NOT restore this
>>unless you want a whole host of touble :-).
I know, I know :)
I copied it into query analyser to test and then thought OMG!!
-----Original Message-----
From: Robertson-Ravo, Neil (RX)
[mailto:[EMAIL PROTECTED]
Sent: 05 March 2003 10:57
To: '[EMAIL PROTECTED]'
Subject: RE: [ cf-dev ] OT: SQL Server Restore
You certainly can restore a DB using a scheduled task; the script you have
below is restoring the master database from a tape (DO NOT restore this
unless you want a whole host of touble :-).
-----Original Message-----
From: Mark Smyth [mailto:[EMAIL PROTECTED]
Sent: 05 March 2003 10:46
To: [EMAIL PROTECTED]
Subject: [ cf-dev ] OT: SQL Server Restore
Guys
This is a bit OT, but i know there are a few SQL server experts on the list.
I'm backing up a SQL server 7 DB and ftp'ing it over from one server to
another using a batch file. One the receiving server (also 7) I need a
scheduled task (for example) which will use the file to restore the database
forcing over the existing database (basically ensuring the 2 DBs are
synched). There doesn't appear to be a way to schedule this in enterprise
manager like there is with the backup. So anyone know how to do this?
I found the script below on google, but I can't make any sense of it. For
example where I specify the BAK file that I previously uploaded
use MASTER
go
Restore Database MASTER From Tape='\\.\Tape0' With File=2, NOUNLOAD
go
Thanks
Mark
--
** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
For human help, e-mail: [EMAIL PROTECTED]
--
** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
For human help, e-mail: [EMAIL PROTECTED]
--
** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
For human help, e-mail: [EMAIL PROTECTED]
--
** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
For human help, e-mail: [EMAIL PROTECTED]
--
** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
For human help, e-mail: [EMAIL PROTECTED]