Executing a SQL Job only once a month and after completion of a specific job

jobs

Let me better explain. My first job executes every 15 minutes (top of the hour, 12:15, 12:30 and 12:45). It does this for every day of the week.
I have a second job that runs at 1:30 AM on the first day of the month. This job only runs once a month.

I need to daisy chain job one with job two only on the last execution of a given month. Meaning, job one executes at 11:45 pm and executes for 3 hours, at that point I need job two to start.

Thanks in advance.
RC

Best Answer

For SQL Server, you can specify On success action to go to the next step, only when the job step #1 is completed. There, use a date/time condition to execute the job#2

if (day(getdate()) = 1 and DATEPART(hh, GETDATE())= 1)
EXEC dbo.sp_start_job N'job#2'

enter image description here

enter image description here