Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase 12»»

Setting job schedule Expand / Collapse
Author
Message
Posted Tuesday, April 1, 2014 2:59 AM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Today @ 4:50 AM
Points: 69, Visits: 182
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.
Post #1556844
Posted Tuesday, April 1, 2014 3:09 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Friday, October 31, 2014 11:06 AM
Points: 5,430, Visits: 10,108
Have you tried the Starting at and Ending at fields in the Daily frequency section?

John
Post #1556848
Posted Tuesday, April 1, 2014 3:13 AM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Today @ 4:50 AM
Points: 69, Visits: 182
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.
Post #1556849
Posted Tuesday, April 1, 2014 3:16 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Friday, October 31, 2014 11:06 AM
Points: 5,430, Visits: 10,108
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
Post #1556850
Posted Tuesday, April 1, 2014 3:19 AM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Today @ 4:50 AM
Points: 69, Visits: 182
Ok will do, thanks.
Post #1556852
Posted Tuesday, April 1, 2014 4:08 AM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Today @ 4:50 AM
Points: 69, Visits: 182
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.
Post #1556880
Posted Tuesday, April 1, 2014 4:21 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Friday, October 31, 2014 11:06 AM
Points: 5,430, Visits: 10,108
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
Post #1556886
Posted Tuesday, April 1, 2014 4:26 AM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Monday, July 21, 2014 2:56 AM
Points: 2,603, Visits: 2,061
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."
Post #1556891
Posted Tuesday, April 1, 2014 4:28 AM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Today @ 4:50 AM
Points: 69, Visits: 182
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......

Post #1556893
Posted Tuesday, April 1, 2014 4:37 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 11:15 AM
Points: 14,005, Visits: 28,387
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
SQL Server 2012 Query Performance Tuning
SQL Server 2008 Query Performance Tuning Distilled
and
SQL Server Execution Plans

Product Evangelist for Red Gate Software
Post #1556900
« Prev Topic | Next Topic »

Add to briefcase 12»»

Permissions Expand / Collapse