May 27, 2011 at 12:07 pm
What is the difference between for and after trigger?
May 27, 2011 at 12:18 pm
After trigger runs after an action has occurred on the table in question.
Jason...AKA CirqueDeSQLeil
_______________________________________________
I have given a name to my pain...MCM SQL Server, MVP
SQL RNNR
Posting Performance Based Questions - Gail Shaw[/url]
Learn Extended Events
May 27, 2011 at 12:19 pm
In SQL Server, they are the same thing...in ORACLE and maybe other DBMS systems an AFTER trigger is different.
The first ingredient in properly employing triggers is to understand the differences between AFTER and INSTEAD OF triggers. AFTER triggers are the same type of trigger that is available in previous versions of SQL Server. They are also known as "FOR triggers" or even simply as "triggers" since they were the only type of trigger available prior to SQL Server 2000.
Lowell
May 27, 2011 at 12:48 pm
The two triggers are "instead of" and "after" for SQL Server. One triggers on the data on its way in, the other triggers with access to the data but stops the initiating action. So, if you have an INSTEAD OF UPDATE trigger, you update a row, and the trigger fires but the row won't update unless you include another update IN the trigger. It allows for some pretty serious interruption when an event occurs.
Never stop learning, even if it hurts. Ego bruises are practically mandatory as you learn unless you've never risked enough to make a mistake.
For better assistance in answering your questions[/url] | Forum Netiquette
For index/tuning help, follow these directions.[/url] |Tally Tables[/url]
Twitter: @AnyWayDBA
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply