SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Setting job schedule


Setting job schedule

Author
Message
navtec
navtec
Right there with Babe
Right there with Babe (742 reputation)Right there with Babe (742 reputation)Right there with Babe (742 reputation)Right there with Babe (742 reputation)Right there with Babe (742 reputation)Right there with Babe (742 reputation)Right there with Babe (742 reputation)Right there with Babe (742 reputation)

Group: General Forum Members
Points: 742 Visits: 299
Hi,

I have a job which I would like to run once between the hours of 11pm and 3am.

The schedule in SSMS does not seem to allow me to specify start and end run times.

How can I do this?

Thanks.
John Mitchell-245523
John Mitchell-245523
SSC-Dedicated
SSC-Dedicated (33K reputation)SSC-Dedicated (33K reputation)SSC-Dedicated (33K reputation)SSC-Dedicated (33K reputation)SSC-Dedicated (33K reputation)SSC-Dedicated (33K reputation)SSC-Dedicated (33K reputation)SSC-Dedicated (33K reputation)

Group: General Forum Members
Points: 33015 Visits: 16637
Have you tried the Starting at and Ending at fields in the Daily frequency section?

John
navtec
navtec
Right there with Babe
Right there with Babe (742 reputation)Right there with Babe (742 reputation)Right there with Babe (742 reputation)Right there with Babe (742 reputation)Right there with Babe (742 reputation)Right there with Babe (742 reputation)Right there with Babe (742 reputation)Right there with Babe (742 reputation)

Group: General Forum Members
Points: 742 Visits: 299
Hi John,

I would have to choose it to run every second. So would it start and stop running every second?

I am running a trace and so would like it to run continuously without any interruptions.
John Mitchell-245523
John Mitchell-245523
SSC-Dedicated
SSC-Dedicated (33K reputation)SSC-Dedicated (33K reputation)SSC-Dedicated (33K reputation)SSC-Dedicated (33K reputation)SSC-Dedicated (33K reputation)SSC-Dedicated (33K reputation)SSC-Dedicated (33K reputation)SSC-Dedicated (33K reputation)

Group: General Forum Members
Points: 33015 Visits: 16637
The job will start at the time specified in the schedule and run until it finishes. If you're running a trace, you probably need two jobs - one to start it at 11pm and one to stop it at 3am.

John
navtec
navtec
Right there with Babe
Right there with Babe (742 reputation)Right there with Babe (742 reputation)Right there with Babe (742 reputation)Right there with Babe (742 reputation)Right there with Babe (742 reputation)Right there with Babe (742 reputation)Right there with Babe (742 reputation)Right there with Babe (742 reputation)

Group: General Forum Members
Points: 742 Visits: 299
Ok will do, thanks.
navtec
navtec
Right there with Babe
Right there with Babe (742 reputation)Right there with Babe (742 reputation)Right there with Babe (742 reputation)Right there with Babe (742 reputation)Right there with Babe (742 reputation)Right there with Babe (742 reputation)Right there with Babe (742 reputation)Right there with Babe (742 reputation)

Group: General Forum Members
Points: 742 Visits: 299
If I was to use only one job will the trace still start and stop at specified times?

If using two jobs would I add my trace script in both jobs or just the start time job?

Or could I add 2 schedules into the same job one for start and one for stopping?

What would work best for this?

Thanks.
John Mitchell-245523
John Mitchell-245523
SSC-Dedicated
SSC-Dedicated (33K reputation)SSC-Dedicated (33K reputation)SSC-Dedicated (33K reputation)SSC-Dedicated (33K reputation)SSC-Dedicated (33K reputation)SSC-Dedicated (33K reputation)SSC-Dedicated (33K reputation)SSC-Dedicated (33K reputation)

Group: General Forum Members
Points: 33015 Visits: 16637
zedtec (4/1/2014)
If I was to use only one job will the trace still start and stop at specified times?

If using two jobs would I add my trace script in both jobs or just the start time job?

Or could I add 2 schedules into the same job one for start and one for stopping?

What would work best for this?

Thanks.

(1) No, unless sp_trace_start (or whatever it's called) allows you to specify how long the trace will run before it stops
(2) No, the second one would just run sp_trace_stop (or whatever it's called)
(3) You can have more than one schedule for the same job, but that wouldn't work here, because you've got two separate tasks. Therefore, the only way to schedule them separately is to put them in separate jobs.

John
free_mascot
free_mascot
SSCertifiable
SSCertifiable (7.2K reputation)SSCertifiable (7.2K reputation)SSCertifiable (7.2K reputation)SSCertifiable (7.2K reputation)SSCertifiable (7.2K reputation)SSCertifiable (7.2K reputation)SSCertifiable (7.2K reputation)SSCertifiable (7.2K reputation)

Group: General Forum Members
Points: 7199 Visits: 2250
It you are talking abou the job you can schedule it to run daily every 10 second between 23:00 to 3:00 hrs. However it won't be possible to set it to schedule every 1 second by single schedule.

---------------------------------------------------
"Thare are only 10 types of people in the world:
Those who understand binary, and those who don't."
navtec
navtec
Right there with Babe
Right there with Babe (742 reputation)Right there with Babe (742 reputation)Right there with Babe (742 reputation)Right there with Babe (742 reputation)Right there with Babe (742 reputation)Right there with Babe (742 reputation)Right there with Babe (742 reputation)Right there with Babe (742 reputation)

Group: General Forum Members
Points: 742 Visits: 299
The sp_trace_create specifies the stop date and time for the trace.

I guess if I set it a start time it should be ok to stop by itself......
Grant Fritchey
Grant Fritchey
SSC Guru
SSC Guru (94K reputation)SSC Guru (94K reputation)SSC Guru (94K reputation)SSC Guru (94K reputation)SSC Guru (94K reputation)SSC Guru (94K reputation)SSC Guru (94K reputation)SSC Guru (94K reputation)

Group: General Forum Members
Points: 94157 Visits: 33010
You can specify a stop time for a trace. So you just need the job to start it and then it will run until the @stoptime property. You can read more about it in the Books Online.

----------------------------------------------------
The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood...
Theodore Roosevelt

The Scary DBA
Author of: SQL Server Query Performance Tuning and SQL Server Execution Plans
Product Evangelist for Red Gate Software
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search