Triggers

  • I haven't created one yet.. I would like to create a Trigger that will kick off a job or a script when all the values of a column are no longer 0. That this the default value of field "Status" is 0. When all the records have changed, where there aren't any more 0s, then the Trigger should run. Is it possible, and what would be the script?

    Thanks...Nali

  • - I wouldn't advise a trigger for this purpose ! (start job) because if the start job fails, your transaction fails !

    - I woudn't advise a trigger for this purpose because your trigger will have to do a table-scan (or index scan if the column is indexed) and chances of deadlocks would be high ! (concurency)

    - Maybe I would advise an asynchrone mechanisme that always succeeds like an alert. Define the alert and have it starting a job. The first step of the job then would be to check if values of the column are no longer 0.

    - just schedule the job to run every x minutes and the first step of the job then would be to check if values of the column are no longer 0.

    Johan

    Learn to play, play to learn !

    Dont drive faster than your guardian angel can fly ...
    but keeping both feet on the ground wont get you anywhere :w00t:

    - How to post Performance Problems
    - How to post data/code to get the best help[/url]

    - How to prevent a sore throat after hours of presenting ppt

    press F1 for solution, press shift+F1 for urgent solution 😀

    Need a bit of Powershell? How about this

    Who am I ? Sometimes this is me but most of the time this is me

  • That makes sense. What I did was create a job that will run every minute to check if there are any 0s letft. If there are 0s, it will do nothing, if not, it will then run the required script.

    Thanks for your help!

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

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