Getting Started with Adobe After Effects - Part 6: Motion Blur
A collection of quick technology learning tips from what people around you learn every day

SP_SETTRIGGERORDER - Specify the FIRST and LAST order of triggers only in SQL Server

Aug 24 2011 6:40AM by Paresh Prajapati   

I just learn to set the priority of the triggers to be fired and came across with one system stored procedure which can be used to set force orders of DML and DDL triggers.

EXEC SP_SETTRIGGERORDER 
    @triggername = 'TriggerName' -- Trigger Name
    @order = 'FIRST'  -- First | Last
    @stmttype = 'UPDATE' -- Insert | Update | Delete

Here is small explaination how triggers prioritized.

  1. For TWO triggers - Trigger defined with "First" order will be fired first. Trigger defined with "Last" order will be fired last or on second.
  2. For THREE triggers - Trigger defined with "First" order will be fired first. Trigger defined with "Last" order will be fired last(on third). Rest trigger without specified in order will be fired in middle order of first and last one, means it will have second order.
  3. For MORE THAN THREE triggers - Trigger defined with "First" order will be fired first. Trigger defined with "Last" order will be fired last. Rest triggers without specified in order will be fired in middle order of first and last one and they will have any of order and no guaranty of fix priority oredrs.

Actually i was believe as we can set orders in first, second, third and so on. But we can set them with First and Last priority only. We can not manage orders of more than three triggers at all.

Read More..   [0 clicks]

Published under: SQL Server Tips ·  ·  ·  · 


Paresh Prajapati
6 · 23% · 7444
11
 
5
 
 
0
Incorrect
 
0
Interesting
 
0
Forgotten



Submit

1  Comments  

  • This saved a holiday for me once :)

    commented on Aug 25 2011 12:41AM
    Nakul Vachhrajani
    4 · 36% · 11624

Your Comment


Sign Up or Login to post a comment.

"SP_SETTRIGGERORDER - Specify the FIRST and LAST order of triggers only in SQL Server" rated 5 out of 5 by 11 readers
SP_SETTRIGGERORDER - Specify the FIRST and LAST order of triggers only in SQL Server , 5.0 out of 5 based on 11 ratings
    Copyright © Rivera Informatic Private Ltd Contact us      Privacy Policy      Terms of use      Report Abuse      Advertising      [ZULU1097]