Question: I need to know the query for this trigger in Microsoft SQL management server. I need it to be specific so I can copy and
I need to know the query for this trigger in Microsoft SQL management server. I need it to be specific so I can copy and paste for the first column and follow the pattern for the others. I need it to be specific please not general. The general stuff confuses me and doesn't help because I don't know what to change. Thanks. The purpose of this assignment is to alter and apply the trigger code.
The purpose of this assignment is to alter and apply the trigger code.
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
Table - Person.Person Columns - BusinessEntityID, PersonType, NameStyle, Title, FirstName, [MiddleName],[LastName], [Suffix], [EmailPromotion], [AdditionalContactInfo], [Demographics], [rowguid], [ModifiedDate]
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
