Home Forums SQL Server 2005 Administering Custom SQL Agent job schedule to run on the 5th working day of each month RE: Custom SQL Agent job schedule to run on the 5th working day of each month

  • Thank you for this script, it was one of the final pieces to my having to run a sub on the 3rd business day of every month.

    For anyone who is interested:

    Paul Turley has a blog that lists how to get the GUID associated with a individual sub in the SSRS Report Manager.

    https://sqlserverbiblog.wordpress.com/2010/03/11/manually-starting-a-report-subscription/#comment-1781

    Then you use the command:

    use msdb

    EXEC sp_start_job @job_name = 'XXXXXXX-8FA9-4DFD-8677-34D451A75C74'

    and the subscription fires at the time the script is completed, so it doesn't matter what the days that are in the sub are set for.

    Also, I used a Aux_Calendar table from:

    http://sqlserver2000.databases.aspfaq.com/why-should-i-consider-using-an-auxiliary-calendar-table.html

    (no author listed, but he is one smart cookie)

    Basically with his number table and calendar with this CTE script and the GUID I can now send any report on any set of days that a manager can dream up.:-D