Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

In a table I have two triggers. When it is called for the first time the first trigger does not fires while the second trigger's got fired. On the next call both first and second trigger action take place. So in my case when calling the trigger first time the first trigger should be executed then the second one. Any suggestions?

share|improve this question
2  
You should show both trigger definitions and the table you try to modify. Without that we can't even guess. –  dezso Nov 22 '12 at 20:21
add comment

1 Answer 1

If I am understanding your question correctly, you are looking for the sp_settriggerorder system stored procedure (http://msdn.microsoft.com/en-us/library/ms186762.aspx). Through the used of this stored proc you can set whether a trigger fires first or last (or undefined, and any trigger in between first and last has no guaranteed order).

(Note: this only applies to AFTER triggers, and cannot be used with INSTEAD OF triggers)

share|improve this answer
    
In my case not like that using sp_settriggerorder because once trigger called for first time the first trigger holds and second trigger called then again calling both executed. while calling first itself i need first trigger to be called –  swami Nov 22 '12 at 5:11
1  
I'm not sure I'm understanding what you're trying to accomplish. Can you reword? –  Thomas Stringer Nov 22 '12 at 16:04
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.