SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


BEFORE TRIGGER Idea Posted to Microsoft Connect


BEFORE TRIGGER Idea Posted to Microsoft Connect

Author
Message
JediSQL
JediSQL
Ten Centuries
Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)

Group: General Forum Members
Points: 1194 Visits: 218
I have wished for SQL Server BEFORE TRIGGERs for a long time. I have posted to Microsoft Connect (their feedback service) about this a few time. I finally put in a post to which they responded "Thanks to this idea. We understand the requirement and we are putting it into the backlog... If this feature gets more votes it would be reconsidered in future releases." Please check out

https://connect.microsoft.com/SQLServer/feedback/details/3127222/before-trigger-behavior-with-execute-original-statement

and, if you like it, please vote it up.

Sincerely,
Daniel
Jeff Moden
Jeff Moden
SSC Guru
SSC Guru (619K reputation)SSC Guru (619K reputation)SSC Guru (619K reputation)SSC Guru (619K reputation)SSC Guru (619K reputation)SSC Guru (619K reputation)SSC Guru (619K reputation)SSC Guru (619K reputation)

Group: General Forum Members
Points: 619447 Visits: 45201
I definitely voted that bad boy up. That was one of the things that I really liked about Oracle for the short 3 year stint that I had to work with it.

--Jeff Moden

RBAR is pronounced ree-bar and is a Modenism for Row-By-Agonizing-Row.
First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column.
If you think its expensive to hire a professional to do the job, wait until you hire an amateur. -- Red Adair

Helpful Links:
How to post code problems
How to post performance problems
Forum FAQs
Ed Wagner
Ed Wagner
SSC Guru
SSC Guru (191K reputation)SSC Guru (191K reputation)SSC Guru (191K reputation)SSC Guru (191K reputation)SSC Guru (191K reputation)SSC Guru (191K reputation)SSC Guru (191K reputation)SSC Guru (191K reputation)

Group: General Forum Members
Points: 191121 Visits: 11907
I voted it up as well. It's now 4 up and 1 down. I have a "few" years of Oracle under my belt and, which I don't use triggers often, it would be handy to have.



Tally Tables - Performance Personified
String Splitting with True Performance
Best practices on how to ask questions
Jeff Moden
Jeff Moden
SSC Guru
SSC Guru (619K reputation)SSC Guru (619K reputation)SSC Guru (619K reputation)SSC Guru (619K reputation)SSC Guru (619K reputation)SSC Guru (619K reputation)SSC Guru (619K reputation)SSC Guru (619K reputation)

Group: General Forum Members
Points: 619447 Visits: 45201
I just posted a plea and a link to this post on "the thread". I'd love to see "BEFORE Triggers" become a reality instead of those gosh-awful "Instead Of" triggers. I have little love in general for Oracle but this one of those things that Oracle absolutely did right from the git. It would make writing audit triggers a whole lot easier to prevent unnecessary duplication in audit tables, which become some of the biggest tables of them all.

--Jeff Moden

RBAR is pronounced ree-bar and is a Modenism for Row-By-Agonizing-Row.
First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column.
If you think its expensive to hire a professional to do the job, wait until you hire an amateur. -- Red Adair

Helpful Links:
How to post code problems
How to post performance problems
Forum FAQs
Hugo Kornelis
Hugo Kornelis
SSC-Forever
SSC-Forever (40K reputation)SSC-Forever (40K reputation)SSC-Forever (40K reputation)SSC-Forever (40K reputation)SSC-Forever (40K reputation)SSC-Forever (40K reputation)SSC-Forever (40K reputation)SSC-Forever (40K reputation)

Group: General Forum Members
Points: 40936 Visits: 13469

Jeff Moden - Saturday, May 20, 2017 2:33 PM
I just posted a plea and a link to this post on "the thread". I'd love to see "BEFORE Triggers" become a reality instead of those gosh-awful "Instead Of" triggers. I have little love in general for Oracle but this one of those things that Oracle absolutely did right from the git. It would make writing audit triggers a whole lot easier to prevent unnecessary duplication in audit tables, which become some of the biggest tables of them all.
[/quote]

Another upvote. I like the idea in the item, allthough I'd like just implementing BEFORE triggers even better.
However, I do not share your dislike for INSTEAD OF triggers. They are a great tool for some specific purposes. I have used them to expose views as if they were the base tables, hiding the actual base tables, and allowing full updatability even when SQL Server itself would consider the view non-updatable or misunderstand how to change the base tables to correspond to the actual change,



Hugo Kornelis, SQL Server/Data Platform MVP (2006-2016)
Visit my SQL Server blog: http://sqlblog.com/blogs/hugo_kornelis
Ed Wagner
Ed Wagner
SSC Guru
SSC Guru (191K reputation)SSC Guru (191K reputation)SSC Guru (191K reputation)SSC Guru (191K reputation)SSC Guru (191K reputation)SSC Guru (191K reputation)SSC Guru (191K reputation)SSC Guru (191K reputation)

Group: General Forum Members
Points: 191121 Visits: 11907
Hugo Kornelis - Sunday, May 21, 2017 3:03 AM

Jeff Moden - Saturday, May 20, 2017 2:33 PM
I just posted a plea and a link to this post on "the thread". I'd love to see "BEFORE Triggers" become a reality instead of those gosh-awful "Instead Of" triggers. I have little love in general for Oracle but this one of those things that Oracle absolutely did right from the git. It would make writing audit triggers a whole lot easier to prevent unnecessary duplication in audit tables, which become some of the biggest tables of them all.

Another upvote. I like the idea in the item, allthough I'd like just implementing BEFORE triggers even better.
However, I do not share your dislike for INSTEAD OF triggers. They are a great tool for some specific purposes. I have used them to expose views as if they were the base tables, hiding the actual base tables, and allowing full updatability even when SQL Server itself would consider the view non-updatable or misunderstand how to change the base tables to correspond to the actual change,
[/quote]

The more tools we have in our toolbox, the more choices we have to implement functionality. As long as they're written well, we can pick the right tool for the job.

Besides, AFTER triggers already exist, so aren't BEFORE triggers just logical?



Tally Tables - Performance Personified
String Splitting with True Performance
Best practices on how to ask questions
Jeff Moden
Jeff Moden
SSC Guru
SSC Guru (619K reputation)SSC Guru (619K reputation)SSC Guru (619K reputation)SSC Guru (619K reputation)SSC Guru (619K reputation)SSC Guru (619K reputation)SSC Guru (619K reputation)SSC Guru (619K reputation)

Group: General Forum Members
Points: 619447 Visits: 45201
Hugo Kornelis - Sunday, May 21, 2017 3:03 AM

Jeff Moden - Saturday, May 20, 2017 2:33 PM
I just posted a plea and a link to this post on "the thread". I'd love to see "BEFORE Triggers" become a reality instead of those gosh-awful "Instead Of" triggers. I have little love in general for Oracle but this one of those things that Oracle absolutely did right from the git. It would make writing audit triggers a whole lot easier to prevent unnecessary duplication in audit tables, which become some of the biggest tables of them all.

Another upvote. I like the idea in the item, allthough I'd like just implementing BEFORE triggers even better.
However, I do not share your dislike for INSTEAD OF triggers. They are a great tool for some specific purposes. I have used them to expose views as if they were the base tables, hiding the actual base tables, and allowing full updatability even when SQL Server itself would consider the view non-updatable or misunderstand how to change the base tables to correspond to the actual change,
[/quote]


You misunderstand my dislike for "Instead Of" triggers. As you say, they ARE great for specific purposes. A perfect example is when the target of an insert is actually an updateable view built for one reason or another. Still, you have to control everything there instead of just what you need to control, whatever that may be.

--Jeff Moden

RBAR is pronounced ree-bar and is a Modenism for Row-By-Agonizing-Row.
First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column.
If you think its expensive to hire a professional to do the job, wait until you hire an amateur. -- Red Adair

Helpful Links:
How to post code problems
How to post performance problems
Forum FAQs
ALZDBA
ALZDBA
SSC Guru
SSC Guru (85K reputation)SSC Guru (85K reputation)SSC Guru (85K reputation)SSC Guru (85K reputation)SSC Guru (85K reputation)SSC Guru (85K reputation)SSC Guru (85K reputation)SSC Guru (85K reputation)

Group: General Forum Members
Points: 85778 Visits: 9283
Jeff Moden - Sunday, May 21, 2017 11:20 AM
Hugo Kornelis - Sunday, May 21, 2017 3:03 AM

Jeff Moden - Saturday, May 20, 2017 2:33 PM
I just posted a plea and a link to this post on "the thread". I'd love to see "BEFORE Triggers" become a reality instead of those gosh-awful "Instead Of" triggers. I have little love in general for Oracle but this one of those things that Oracle absolutely did right from the git. It would make writing audit triggers a whole lot easier to prevent unnecessary duplication in audit tables, which become some of the biggest tables of them all.

Another upvote. I like the idea in the item, allthough I'd like just implementing BEFORE triggers even better.
However, I do not share your dislike for INSTEAD OF triggers. They are a great tool for some specific purposes. I have used them to expose views as if they were the base tables, hiding the actual base tables, and allowing full updatability even when SQL Server itself would consider the view non-updatable or misunderstand how to change the base tables to correspond to the actual change,


You misunderstand my dislike for "Instead Of" triggers. As you say, they ARE great for specific purposes. A perfect example is when the target of an insert is actually an updateable view built for one reason or another. Still, you have to control everything there instead of just what you need to control, whatever that may be.
[/quote]

Considered the new Pirates of the Caribbean is released in 2 days, guess how I read the '...ARE....' in this reply ( #Palmface ) ;-)


Johan


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


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


press F1 for solution, press shift+F1 for urgent solution :-D


Need a bit of Powershell? How about this

Who am I ? Sometimes this is me Alien but most of the time this is me Hehe
Brandie Tarvin
Brandie Tarvin
SSC Guru
SSC Guru (113K reputation)SSC Guru (113K reputation)SSC Guru (113K reputation)SSC Guru (113K reputation)SSC Guru (113K reputation)SSC Guru (113K reputation)SSC Guru (113K reputation)SSC Guru (113K reputation)

Group: General Forum Members
Points: 113000 Visits: 9583
JediSQL - Friday, May 19, 2017 5:47 PM
I have wished for SQL Server BEFORE TRIGGERs for a long time. I have posted to Microsoft Connect (their feedback service) about this a few time. I finally put in a post to which they responded "Thanks to this idea. We understand the requirement and we are putting it into the backlog... If this feature gets more votes it would be reconsidered in future releases." Please check out

https://connect.microsoft.com/SQLServer/feedback/details/3127222/before-trigger-behavior-with-execute-original-statement

and, if you like it, please vote it up.


Done.

Brandie Tarvin, MCITP Database AdministratorLiveJournal Blog: http://brandietarvin.livejournal.com/On LinkedIn!, Google+, and Twitter.Freelance Writer: ShadowrunLatchkeys: Nevermore, Latchkeys: The Bootleg War, and Latchkeys: Roscoes in the Night are now available on Nook and Kindle.
Lynn Pettis
Lynn Pettis
SSC Guru
SSC Guru (273K reputation)SSC Guru (273K reputation)SSC Guru (273K reputation)SSC Guru (273K reputation)SSC Guru (273K reputation)SSC Guru (273K reputation)SSC Guru (273K reputation)SSC Guru (273K reputation)

Group: General Forum Members
Points: 273629 Visits: 41200
InterBase had both BEFORE and AFTER Triggers. I liked that as well, and having them in SQL Server would be a great addition.

Cool
Lynn Pettis

For better assistance in answering your questions, click here
For tips to get better help with Performance Problems, click here
For Running Totals and its variations, click here or when working with partitioned tables
For more about Tally Tables, click here
For more about Cross Tabs and Pivots, click here and here
Managing Transaction Logs

SQL Musings from the Desert Fountain Valley SQL (My Mirror Blog)
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum








































































































































































SQLServerCentral


Search