Need to execute Job level Query

  • Hi Every one, 

       I would like to execute an insert query before starting a job(in SQL Server Agent) and an update query once the job is completed, just to keep track the success of the job and the each and every steps involved in it. I have max of 15 steps (dtsx packages)inside my job and i know we can very well use the Execute SQL task component to accomblish this task but i want to do this in job level and not in package level.

    Is there any way to do this ? Requesting a smart solution.

    Thanks in advance.

    Regards

    suresh

     

  • How about this:

    Create a new job.  The first step you execute your INSERT statement.  The second step you call SP_START_JOB() to execute your main Job. And the third step is your UPDATE statement.

    I don't know if SP_START_JOB() is asynchronous or not.

     

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

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