You need to create a trigger that supports the followin…

You are a SQL Server 2014 Developer. A database that you work on contains two tables that are defined as
follows:

Product is an important table that has sensitive audit requirements.
You need to create a trigger that supports the following requirements:
Every row that is inserted or updated in Product will reflect its actual LastUpdatedDate and LastUpdatedBy
values in the Product table.
Any row that is updated or deleted must write a new record reflecting the OLD values into the ProductAudit
table.
Any error that occurs during the course of the trigger’s execution must prevent the changes from happening.
Develop the solution by selecting and arranging the required code blocks in the correct order.
You may not need all of the code blocks.
Select and Place:

You are a SQL Server 2014 Developer. A database that you work on contains two tables that are defined as
follows:

Product is an important table that has sensitive audit requirements.
You need to create a trigger that supports the following requirements:
Every row that is inserted or updated in Product will reflect its actual LastUpdatedDate and LastUpdatedBy
values in the Product table.
Any row that is updated or deleted must write a new record reflecting the OLD values into the ProductAudit
table.
Any error that occurs during the course of the trigger’s execution must prevent the changes from happening.
Develop the solution by selecting and arranging the required code blocks in the correct order.
You may not need all of the code blocks.
Select and Place:

Answer:

Explanation:
Note:
* Executing a ROLLBACK TRANSACTION or COMMIT TRANSACTION Transact-SQL statement inside a
stored procedure or trigger is possible, but doing so may cause errors.



Leave a Reply 0

Your email address will not be published. Required fields are marked *