Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member
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 attempt to change the structure of the database. So something like dropping a table can be blocked by a trigger.
Get unlimited access to all courses for just $25/month.Become a member
82 Video lessons · 75166 Viewers
80 Video lessons · 130031 Viewers
52 Video lessons · 64183 Viewers
59 Video lessons · 49985 Viewers
Access exercise files from a button right under the course name.
Search within course videos and transcripts, and jump right to the results.
Remove icons showing you already watched videos if you want to start over.
Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.
Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.
Your file was successfully uploaded.