Question: Alter and apply the trigger code. Use AdventureWorks Apply the trigger code provided below to each column of the Person.Person table to track the number

Alter and apply the trigger code. Use AdventureWorks

Apply the trigger code provided below to each column of the "Person.Person" table to track the number of modifications of data for each column in the table.

Trigger Code:

CREATE TRIGGER [TRIGGER_ALTER_COUNT] ON [dbo].[tblTriggerExample]

FOR INSERT, UPDATE

AS

BEGIN

DECLARE @TransID VARCHAR(36)

SELECT @TransID = TransactionID FROM INSERTED

UPDATE [dbo].[tblTriggerExample] SET AlterCount = AlterCount + 1

,LastUpdate = GETDATE()

WHERE TransactionID = @TransID

END

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!