DRAG DROP
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:
1. Every row that is inserted or updated in Product will reflect its actual LastUpdatedDate
and LastUpdatedBy values in the Product table.
2. Any row that is updated or deleted must write a new record reflecting the OLD values into
the ProductAudit table.
3. 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.
Answer: See the 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.