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 using 'sp_add_jobschedule' (T-SQL)

Author  Topic 

Maria
Starting Member

12 Posts

Posted - 2001-11-23 : 10:03:26
Hello,

I am trying to schedule a complete database restore using TSQL (as Ent.
Manager doesn't offer this functionality). my logic tells me: create a
restore job like so:

RESTORE DATABASE DOGSTraining
FROM DISK = 'd:\mssql7\Ad-hoc Backup\DOGSTraining\DOGSTrainingNov.BAK'

Then create a job shedule using this syntax from BOL:

USE msdb
EXEC sp_add_jobschedule @job_name = 'NightlyRestore',
@name = 'ScheduledRestore',
@freq_type = 4, -- daily
@freq_interval = 1,
@active_start_time = '1:00:00'

I'm assuming that @jobname is meant to the first statement,i.e. the
RESTORE DATABASE job I created above? if this is the case, how do i name
this RESTORE DATABASE job so that i can call it in the
'sp_add_jobschedule' statement? Do i have to use sp_addumpdevice
somewhere along the line?(although i thought this stored procedure was
only for backups...).

All help is fully appreciated!

Kind rgds,

Maria

Maria Bermudes
DBA
London
   

- Advertisement -