SQL Server: Triggers

Level : Intermediate
Mentor: Shailendra Chauhan
Type : GuidedLab
Points : 10
Duration : 00:40:00

Lab Details

Description

A trigger is a procedure that executes when a database event occurs. Triggers can help enforce data and referential integrity in the database

In this lab, you will learn how to use Triggers in SQL Server.


Based on this Customer and Supplier Schema, generate the solutions to the respective queries listed below:

  1. Create a Trigger that recalculates the order amount after an orderitem row is changed.
  2. Create a Trigger that prevents changes to order items.
  3. Change the Error Message in the OrderItemBlock Trigger.
  4. Rename the OrderItemBlock Trigger to OrderItemPreventChange.
  5. Prevent users from making table schema changes. Rollback any attempt.

Lab Objective

Upon completion of this lab, you will be able to:

  • Gain Hands-On Experience on SQL Server Triggers.

Prerequisites

  • You should have a conceptual understanding of Triggers.
  • You must have SQL Server Installed on your systems.
Self-paced Membership
  • 24+ Video Courses
  • 825+ Hands-On Labs
  • 400+ Quick Notes
  • 50+ Skill Tests
  • 10+ Interview Q&A Courses
  • 10+ Real-world Projects
  • Career Coaching Sessions
  • Email Support
Upto 60% OFF
Know More
Still have some questions? Let's discuss.
CONTACT US
Accept cookies & close this