I do this sort of thing all the time.
SQL 2005 makes is really easy to obtain the script, (which will work in
2000 by the way). Replace the paths with whatever works for your
environment
RESTORE DATABASE [YourSourceDatabaseName]
FROM DISK = N'F:\directory\subdirectory\etc\YourBackupFile.BAK'
WITH FILE = 1
, MOVE N'YourSourceDatabaseDataFileName' TO N'D:\Program
Files\Microsoft SQL Server\MSSQL\DATA\NewDatabaseFileName.mdf'
, MOVE N'YourSourceLogFileName' TO N'D:\Program Files\Microsoft SQL
Server\MSSQL\DATA\NewDatabaseLogFileName.ldf'
, NOUNLOAD
, REPLACE
, STATS = 10
Carolyn J
-----Original Message-----
From: Valerian Rodrigues
[mailto:mssqldba-ezmlmshield-x47078791.[Email address protected]
Sent: Friday, April 27, 2007 7:52 AM
To: LazyDBA Discussion
Subject: Restore Database Automatically using Schedule Jobs
Hello all
Is there any way to schedule a job to restore the database automatically
in SQL 2000 and very important to set or define the location of Data
files (MDF) and transactions files (LDF)?
Eg if we have backup the database on mapped x: drive as Dbtest.bak. We
need to schedule it automatically so that it restores this database as
DBReport. But DBreport.mdf file should reside on D: drive and DBreport
_log.ldf should reside on H: drive
If possible, can I have this script to execute this automatically?
Thanks & Regards
Valerian
---------------------------------------------------------------------
TO REPLY TO EVERYBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY To post a
dba job: http://jobs.lazydba.com To subscribe : http://www.LazyDBA.com
To unsubscribe: http://www.lazydba.com/unsubscribe.html
MS Sql Server LazyDBA home page