Skip to main content

Building and Optimizing Triggers in SQL Server

Learn how to design and implement triggers in SQL Server using real-world examples.

Start Course for Free
4 Hours15 Videos49 Exercises8,230 Learners
3800 XP

Create Your Free Account



By continuing, you accept our Terms of Use, our Privacy Policy and that your data is stored in the USA. You confirm you are at least 16 years old (13 if you are an authorized Classrooms user).

Loved by learners at thousands of companies

Course Description

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.

  1. 1

    Introduction to Triggers


    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.

    Play Chapter Now
    50 xp
    Types of trigger
    50 xp
    Creating your first trigger
    100 xp
    Practicing creating triggers
    100 xp
    How DML triggers are used
    50 xp
    When to use triggers
    50 xp
    Creating a trigger to keep track of data changes
    100 xp
    Trigger alternatives
    50 xp
    Triggers vs. stored procedures
    100 xp
    Triggers vs. computed columns
    100 xp

In the following tracks

Data AnalystSQL Server for Database Administrators


Becca RobinsMona KhalilMarianna Lamnina
Florin Angelescu Headshot

Florin Angelescu

Database Developer

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.
See More

What do other learners have to say?

I've used other sites—Coursera, Udacity, things like that—but DataCamp's been the one that I've stuck with.

Devon Edwards Joseph
Lloyds Banking Group

DataCamp is the top resource I recommend for learning data science.

Louis Maiden
Harvard Business School

DataCamp is by far my favorite website to learn from.

Ronald Bowers
Decision Science Analytics, USAA