Scheduling an application stored procedure

  • HI. I have a developer that has created a stored procedure to do some updates to a table and he would like this to automatically run monthly. I'm not sure how I do this. I've used sql server agent to schedule my backups but not a user written stored procedure.

  • Just create a new job, and add a single step.

    Set the step to type 'Transact-SQL Script' and add as command 'exec <the_name_of_the_procedure>', like you would do when running the user procedure from the query analyzer.

    And of course, you will have to set the other correct step and job properties ...

  • Make sure you either pick the db from the dropdown to show where it should execute, or fully qualify it like this:

    exec db.owner.storedprocname

    Andy

    http://www.sqlservercentral.com/columnists/awarren/

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply