|
|
|
Grasshopper
      
Group: General Forum Members
Last Login: Wednesday, May 01, 2013 6:17 AM
Points: 21,
Visits: 236
|
|
Using DTS in 2000 I run a check for every second Thursday with the following code and set the 'job' to run every Thursday. If it is the right day the DTS continues otherwise it simply fails.
'******************************************************* ' Visual Basic ActiveX Script '*******************************************************
' Test for the second week since a Job can only be set ' to work within a week. Prime with a run date.
Function Main()
Dim myDate Dim oddEven
myDate = datediff("ww","8/10/2007",date()) oddEven = (myDate Mod 2)
if oddEven = 0 then
Main = DTSTaskExecResult_Success
else Main = DTSTaskExecResult_failure end if
End Function
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Monday, September 13, 2010 1:05 PM
Points: 2,
Visits: 11
|
|
| One thing Peter failed to mention is that if you want to see lots of job history, be sure the job history log is big enough (Job System within SQL Server Agent properties).
|
|
|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Yesterday @ 7:30 AM
Points: 142,
Visits: 524
|
|
An easy way to do it is to have a first step that determines if today is the day the dw_job should run or the dm_job. You can cause the step to fail based on your criteria of choice (you can use a SQL step or ActiveX to do this). Then it's simply On Failure... load one, or On Succes.... load the other, in steps 2 and 3. Remember to quit on success and failure in 2, tho.. ;)
|
|
|
|
|
SSC Eights!
      
Group: General Forum Members
Last Login: Wednesday, May 09, 2012 10:26 AM
Points: 891,
Visits: 1,958
|
|
Rasool Omidakhsh (11/16/2007) ...I have to run this dm_job everyday. ... [dw_job] I have to run this job on every second thursday. ... I don't see a problem with this, I would do it along these lines. dw_job has one schedule, occurs monthly, 2nd Thursday, runs once at 00:45. dm_job has five schedules, first one is weekly on Friday through Wednesday, the other schedules run 1st, 3rd, 4th, and last Thursday.
Unless I misunderstood your saying second Thursday and you meant every other Thursday, in which case do dw as Weekly, Every 2 Weeks, Starting 11/01/2007, then have dm_job doing the Thursday run Every 2 Weeks starting 11/08/2007. dm would still need the Friday-Wednesday schedule.
I think that would do it, but I could be wrong.
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Thursday, February 14, 2008 9:14 AM
Points: 1,
Visits: 1
|
|
| Were you able to complete the conditional scheduling for a SQL report?
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Saturday, August 07, 2010 12:46 AM
Points: 2,
Visits: 24
|
|
| Excellent article on Jobs.
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Friday, November 26, 2010 6:47 AM
Points: 1,
Visits: 0
|
|
| Thanks for such good article
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Wednesday, February 01, 2012 10:46 AM
Points: 1,
Visits: 0
|
|
hi ,
i c your msg, and i have the same question. Can I perform this schedule jobs dynamically, with some conditional parameters ... ?? .. if you know something about it, please contact me ...
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Friday, October 12, 2012 6:50 AM
Points: 1,
Visits: 1
|
|
i have set up a job to run every five minutes. If somehow the job takes more than five minutes in execution, will the sql scheduler run another instance of same job on five minutes cycle? when the last execution has not been completed?
|
|
|
|