12. Triggers and Audit Trail - Designing Database Solutions with Microsoft SQL Server 2022

Sdílet
Vložit
  • čas přidán 6. 08. 2024
  • In this lesson, Joed Goh explains the use of Triggers in Microsoft SQL Server. Triggers are commonly used to maintain data integrity, control server operations, or perform auditing tasks to strictly implement business rules.
    This lesson demonstrates how to create DML triggers to perform basic auditing actions on a table when DML commands such as INSERT, UPDATE, or DELETE operations are being performed.
    Table of Contents:
    00:00 Introduction
    01:14 AFTER Trigger (INSERT)
    04:45 AFTER Trigger (DELETE)
    05:41 AFTER Trigger (UPDATE)
    07:36 The UPDATE() Function
    10:35 INSTEAD OF Trigger (DELETE)
    PLAYLISTS:
    Designing Database Solutions with Microsoft SQL Server 2019
    • Designing Database Sol...
    Artificial Intelligence and Machine Learning Foundations
    • Artificial Intelligenc...
    IoT Development
    • Internet of Things
    Android App Development in Kotlin
    • Android App Developmen...
    Embedded Systems using Arduino Uno
    • Embedded Systems using...
    Data Structures and Algorithms using C#
    • Data Structures and Al...

Komentáře • 5

  • @shaliniasadi6757
    @shaliniasadi6757 Před 11 měsíci

    tq

  • @radoslavdimitrov7505
    @radoslavdimitrov7505 Před 10 měsíci

    when I do select * from inserted or select * from deleted outside of a trigger it doesn't work, says there is no such object. I am using SQL Server Developer Edition 2022. Could you explain why?

  • @user-td4lx2xz5i
    @user-td4lx2xz5i Před 7 měsíci

    How to display which column name delete or update.... its possible or not

  • @nishagupta9520
    @nishagupta9520 Před 9 měsíci

    you have not inserted anything for id in products , nor in product in productsaudit ,
    if i m trying to do the same , i m getting columns do not match ..
    you have not do any type of autoincrement . can u reply

    • @joedgoh
      @joedgoh  Před 9 měsíci

      Yes, please add autoincrement attributes to the IDs of your tables. Thanks.