始める無料で始める

Tracking table changes

You need to create a new trigger at the database level that logs modifications to the table TablesChangeLog.

The trigger should fire when tables are created, modified, or deleted.

この演習はコースの一部です

Building and Optimizing Triggers in SQL Server

コースを見る

演習の手順

Create the new trigger following the company's requirements.

実践的なインタラクティブ演習

このサンプルコードを完成させて、この演習に挑戦してみましょう。

-- Create the trigger to log table info
CREATE TRIGGER TrackTableChanges
ON ___
FOR CREATE_TABLE,
	___,
	DROP_TABLE
AS
	INSERT INTO ___ (EventData, ChangedBy)
    VALUES (EVENTDATA(), USER);
コードを編集して実行