Friday, March 30, 2012

question about scheduled job in general..

background info: sql2k on nt5
I have a database backup job created by maintenance plan. so the backup file
looks like
MyDatabase_20040430.bak
the job was run nightly so the suffix of the backup file changes daily ( to
20040501, 20040502 and so on)
my question is, i have another scheduled tasks doing some process on
MyDatabase, and I want to back up the database after the process is done, as
the last step fo the scheduled task.
can i call out the scheduled job within a scheduled task? (what would the
syntax be?)
the other concern is, the job created by the manitenance plan actually
backing up several other databases as well. If I just want to back up the
MyDatabase, I need to issue a more specific backup statement, but then how
I'm going to specify the existing dump (backup) file name for MyDatabase,
since the file name changes (as indicated above).
Any suggestions? Thank you.
Steve> can i call out the scheduled job within a scheduled task? (what would the
> syntax be?)
I believe the syntax is
EXEC msdb..sp_start_job @.jobname='<job name>'
--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/

No comments:

Post a Comment