Loved by learners at thousands of companies
Auditing your SQL Server database and keeping data integrity can be a challenging task for DBAs and database developers. SQL Server triggers are special types of stored procedures designed to help you achieve consistency and integrity of your database. This course will teach you how to work with triggers and use them in real-life examples. Specifically, you will learn about the use cases and limitations of triggers and get practice designing and implementing them. You will also learn to optimize triggers to fit your specific needs.
Introduction to TriggersFree
An introduction to the basic concepts of SQL Server triggers. Create your first trigger using T-SQL code. Learn how triggers are used and what alternatives exist.Introduction50 xpTypes of trigger50 xpCreating your first trigger100 xpPracticing creating triggers100 xpHow DML triggers are used50 xpWhen to use triggers50 xpCreating a trigger to keep track of data changes100 xpTrigger alternatives50 xpTriggers vs. stored procedures100 xpTriggers vs. computed columns100 xp
Classification of Triggers
Learn about the different types of SQL Server triggers: AFTER triggers (DML), INSTEAD OF triggers (DML), DDL triggers, and logon triggers.AFTER triggers (DML)50 xpTracking retired products100 xpThe TrackRetiredProducts trigger in action100 xpPracticing with AFTER triggers100 xpINSTEAD OF triggers (DML)50 xpPreventing changes to orders100 xpPreventOrdersUpdate in action50 xpCreating the PreventNewDiscounts trigger100 xpDDL triggers50 xpTracking table changes100 xpUsing FOR in a trigger50 xpPreventing table deletion100 xpLogon triggers50 xpEnhancing database security100 xpDefining a logon trigger50 xp
Trigger Limitations and Use Cases
Find out known limitations of triggers, as well as common use cases for AFTER triggers (DML), INSTEAD OF triggers (DML) and DDL triggers.Known limitations of triggers50 xpTrigger limitations50 xpCreating a report on existing triggers100 xpUse cases for AFTER triggers (DML)50 xpKeeping a history of row changes100 xpTable auditing using triggers100 xpUse cases for INSTEAD OF triggers (DML)50 xpPreventing changes to Products100 xpChecking stock before placing orders100 xpUse cases for DDL triggers50 xpDatabase auditing100 xpPreventing server changes100 xp
Trigger Optimization and Management
Learn to delete and modify triggers. Acquaint yourself with the way trigger management is done. Learn how to investigate problematic triggers in practice.Deleting and altering triggers50 xpRemoving unwanted triggers100 xpModifying a trigger's definition100 xpDisabling a trigger100 xpRe-enabling a disabled trigger100 xpTrigger management50 xpManaging existing triggers100 xpCounting the AFTER triggers50 xpTroubleshooting triggers50 xpKeeping track of trigger executions100 xpIdentifying problematic triggers100 xpWrapping up50 xp
PrerequisitesIntermediate SQL Server
I am an experienced database developer with over 7 years of expertise in SQL Server development and administration. I also use PowerShell actively for process and task automation and deployments. In recent years, I have developed a new passion for Azure services for migration and maintenance, diving further into moving on-premise services to cloud, which I truly believe is the future. I'm a proactive, results-oriented team player. I always want to learn new things and seek new challenges that will contribute to my professional development, and also feel accomplished when I can bring new knowledge to other people.