The worst schema I had to implement: A customer wanted us to reboot the server for patches on the first friday of the month around 1am.
How do you schedule updates for 'the thursday before the first friday of the month, 22:00'? (Hint: 'The first Thursday of the month' does NOT work)
Schedule the job to run every Thursday. Include this in the job. If @Today is the right Thursday, it will do something. Otherwise, it'll say so it's not the right Thursday and exit.
DECLARE @Today DATETIME = GETDATE()
IF @Today IN
(--==== This finds the Thurday before the first Friday of the current and next months.
SELECT ThuBefore1stFri = DATEADD(dd,-1,DATEADD(dd,DATEDIFF(dd,4,amo.Seventh)/7*7,4))
(DATEADD(mm,DATEDIFF(mm,6,@Today),6)) --First Friday of Current Month
,(DATEADD(mm,1,DATEADD(mm,DATEDIFF(mm,6,@Today),6))) --First Friday of Next Month
--===== This is what will run if @Today is the Thursday before the first Friday of the month.
SELECT 'Replace with what the job should do';
--===== Otherwise, we'll just exit the job.
SELECT 'Not the Thursday before the first Friday of the month. Exiting.';