Triggers

External Article

Avoid External Dependencies in SQL Server Triggers

  • Article

I sometimes want to perform auditing or other actions in a trigger based on some criteria. More specifically, there are a few cases that may warrant an e-mail; for example, if a web sale takes place that requires custom or overnight shipping and handling. It is tempting to just add code to the trigger that sends an e-mail when these criteria are met. But this can be problematic for two reasons: (1) your users are waiting for that processing to occur, and (2) if you can't send the e-mail, how do you decide whether or not to roll back the transaction, and how do you bring the problem to the attention of the administrator?

2011-02-14

2,819 reads

Blogs

The Book of Redgate: Products

By

We are product focused at Redgate Software. Here is another of our values that...

KDA: Echoes of Deception - Case 7

By

A fugitive cyber-criminal, a wingsuit, and 24 million flight records. Somewhere between Doha and...

Do This Before You Contact Your SQL Server Consultant

By

Say you need outside help. You’ve exhausted all the things that you could do...

Read the latest Blogs

Forums

Implicit Conversions Cripple SQL Server

By sabyda

Comments posted to this topic are about the item Implicit Conversions Cripple SQL Server

BIT_COUNT() III

By Steve Jones - SSC Editor

Comments posted to this topic are about the item BIT_COUNT() III

The Mythical Bus Accident

By Steve Jones - SSC Editor

Comments posted to this topic are about the item The Mythical Bus Accident

Visit the forum

Question of the Day

BIT_COUNT() III

In SQL Server 2025, I run this code:

select bit_count(-1)
What is returned?

See possible answers