Execution based on completion of another transaction or session

  • Hi,

    I need a conditional logic or a logical script that would execute a script from another session (spid) when one of the session completes. For e.g if I am running dbcc shrinkfile for which the percentage gets recorded in sys.dm_exec_requests from say spid = 65 and I need to execute another script from say session id = 68 based on the completion of script in session id 65. How would I achieve that goal. I don't want to monitor the process whole night and then execute the script. I have a tight window and I don't want to be awake whole night for this. I know one way would be to execute this in separate batches in a single sesssion, but I don't want to go that route. Also, I need to consider a situation where I am half way down the shrink or any process for that matter and now I can't afford to roll back and start afresh. I need something handy that I can rely on that will do my work.

    Regards,

    Feivel

  • You can use SSIS package and provide precedence constraint is success then only go to next step.

  • latitiacasta (9/20/2016)


    You can use SSIS package and provide precedence constraint is success then only go to next step.

    Thanks! but I need something in tsql. Like a conditional logic.

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

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