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 2005 Forums
 SQL Server Administration (2005)
 how to script a schedule

Author  Topic 

Peter99
Constraint Violating Yak Guru

498 Posts

Posted - 2012-02-07 : 15:04:30
Hi,

How to script a schedule in sql sever agent. I did not see any option there.

Thanks

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2012-02-07 : 15:12:19
use msdb.dbo.sp_add_jobschedule for creating schedules

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

russell
Pyro-ma-ni-yak

5072 Posts

Posted - 2012-02-07 : 16:31:27
If you mean to generate the script for an existing schedule, just script the job. Then scroll down to the bottom where the sp_add_jobschedule is.
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2012-02-07 : 16:38:42
This is one time I use the Wizard to set up a job.

I then script the Job for other environments



Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx


Want to help yourself?

http://msdn.microsoft.com/en-us/library/ms130214.aspx

http://weblogs.sqlteam.com/brettk/

http://brettkaiser.blogspot.com/


Go to Top of Page

Peter99
Constraint Violating Yak Guru

498 Posts

Posted - 2012-02-08 : 12:20:41
Thanks everyone for their help.
Go to Top of Page

Bustaz Kool
Master Smack Fu Yak Hacker

1834 Posts

Posted - 2012-02-09 : 19:06:35
FWIW, this procedure will yield all the details you'll need if you want to script a set of schedules.[CODE]exec msdb.dbo.sp_help_schedule[/CODE]HTH

=================================================
Men shout to avoid listening to one another. -Miguel de Unamuno
Go to Top of Page
   

- Advertisement -