Why Should You Use Triggers When Using an SQL Server?


show more Why use triggers? provides you with in-depth training on Business. Taught by Martin Guidry as part of the SQL Server: Triggers, Stored Procedures, and Functions show less
please wait ...

Why use triggers?

Let's talk little bit about some of the advantages of using triggers. Triggers can be used to audit changes to the database. We can set up triggers on tables to record every change to every record in the table. Typically, this is accomplished by copying the record before it's modified to a different table. A table we might call historical data. Triggers can also be used to ensure the integrity of our data. SQL Server has some other ways to do this such as checks and constraints.

But those are designed to be pretty simple. They check for a data type or they might check to make sure some value is greater than or less than some other value. Triggers allow for more robust logic. We can generate data integrity rules that implement complex business logic, that can reference multiple tables based on the value in those tables, decide if a certain piece of data is valid or invalid. Triggers can also be used to block mistakes. Triggers can undo an attempt to change data.

They can even undo an a...

Why use triggers?
Video duration: 1m 10s 1h 52m Advanced

Viewers:

Why use triggers? provides you with in-depth training on Business. Taught by Martin Guidry as part of the SQL Server: Triggers, Stored Procedures, and Functions

Subjects:
Business Developer IT
Software:
SQL Server
Author:
please wait ...