How to customize sql server agent jobs

I need to be able to schedule a job on the 10th of each month and have it run for a set number of days or until a specified date.

Is there any way to customize sql server agent jobs using some sort of API or something?

  • MSSQL Handle/Split Unknown Date String Format
  • How can a sum of a column in sql server where values are 2 decimal places result in 0000000000087?
  • Transaction isolation level REPEATABLE READ causes deadlocks
  • How come the message “Table is marked for deletion” keeps appearing?
  • How to add a default value to an already existing column?
  • pivot not working as desired
  • Thanks.

    3 Solutions collect form web for “How to customize sql server agent jobs”

    You can accomplish using the SQL Job Schedule properties by using more than one schedule for the job. You can schedule the job to run on the 10th day of the month (with the option for an end date). You can then create multiple schedules, one for the 11th, 12th, etc.

    The SQL Server Agent does not have a schedule option like you need, so I think your workaround is as good as it gets for keeping it inside SQL Server.

    The Windows Task Scheduler however does have an option to run a job on the ‘x’ day of the month, maybe kicking your sproc off using sqlcmd via Windows Task Scheduler is an alternate solution?

    Hope this helps

    I still can’t find any way of customizing the job schedule, but I have figured a way around it by adding the condition to the job step:

    IF (DAY(GetDate()) >= 10)

    And setting the schedule to run every day.

    MS SQL Server is a Microsoft SQL Database product, include sql server standard, sql server management studio, sql server express and so on.