DRAG DROP
You have two tables named UserLogin and Employee respectively.
You need to create a Transact-SQL script that meets the following requirements:
– The script must update the value of the IsDeleted column for the UserLogin table to 1 if the value of the Id column for the User Login table is equal to 1.
– The script must update the value of the IsDeleted column of the Employee table to 1 if the value of the Id column is equal to 1 for the Employee table when an update to the User Login table throws an error.
– The error message "No tables updated!" must be produced when an update to the Employee table throws an error.
Which five Transact-SQL segments should you use to develop the solution? To answer, move the appropriate Transact-SQL segments from the list of Transact-SQL segments to the answerarea and arrange them in the correct order.
Answer:
Explanation:
A TRY block must be immediately followed by an associated CATCH block. Including any other statements between the END TRY and BEGIN CATCH statements generates a syntax error.
Note: END TRY statements are missing in the options, which makes this question confusing.
References: https://msdn.microsoft.com/en-us/library/ms175976.aspx