triggers before insert and row level. - by chuck02323

Status : 


Sign in
to vote
ID 285655 Comments
Status Active Workarounds
Type Suggestion Repros 2
Opened 6/30/2007 5:05:01 PM
Access Restriction Public


Need to have real Before triggers and row level triggers.  SQL doesn't have these triggers or sequences.  They have "instead of" but not a real Before Trigger like enterprise level databases have.  It's a real pain to program in SQL or to convert from Oracle or MySQL.
Sign in to post a comment.
Posted by JediSQL on 3/17/2017 at 12:29 PM
Please see my "BEFORE TRIGGER Behavior with EXECUTE ORIGINAL_STATEMENT" topic.
Posted by JediSQL on 2/7/2014 at 3:36 PM
I have been needing BEFORE TRIGGERS for a long time, too. We have some complex integrity constraints, and it would be a lot cleaner and more efficient to block an action than roll it back afterwards.
Posted by HPWP7 on 4/2/2010 at 1:06 AM
As a business developer using Oracle with Microsoft development tools, MS SQL server lack of support for row-level triggers changes "migrate" to "re-write" and "maybe" to "no way" Like many small ISVs we would love to have the chance (time/money) to re-write all of our applications but re-write something that works well vs make new features or modules to our applications ... its just bad business and you can go out of business thinking that way.
Posted by Erland Sommarskog on 8/6/2008 at 2:15 PM
Yes to BEFORE TRIGGERS, this is long overdue. Per row-triggers? Maybe they work well in Oracle,
but I would suspect they would be a performance killer in SQL Server. So you need to rewrite those
Oracle triggers anyway.
Posted by cafm on 7/16/2008 at 7:11 AM
Yes, it's time for it
Posted by David Frommer on 7/16/2008 at 6:39 AM
I agree we need true BEFORE Triggers. Row level triggers, I would have to say NO, SQL is a SET based language
Posted by John Hardin on 8/17/2007 at 1:01 PM
INSTEAD OF is not a workable replacement for BEFORE.

Trigger support needs to be: one INSTEAD OF, or any number of BEFORE and AFTER with sequence control.
Posted by Microsoft on 8/13/2007 at 2:53 PM
Thank you for posting your request. We realize that BEFORE triggers are extremely useful, specifically in migration scenarios. Unfortunately, we are not able to provide this functionality in SQL Server 2008. We are considering it for a future release. Meanwhile, we suggest using INSTEAD OF triggers to achieve similar functionality.
Posted by Ahsukal on 7/8/2007 at 5:49 AM
That request is for 3 features instead of one!
1) I agree about Before Triggers
2) Row triggers are easily done with SQL although with non ANSI syntax. But they are a bad practice, so low priority for me.
3) Sequence would be nice eventually, but it is not a show stopper.
Posted by Mark Yudkin on 7/3/2007 at 12:12 AM
BEFORE triggers are part of ANS SQL 99 (and 2003), and as such have been implemented by many manufacturers (Oracle, IBM).

It's time MS implemented ANS SQL.