Which Transact-SQL segment should you insert at line 06?

You are developing a Microsoft SQL Server 2012 database for a company. The database contains a table that is defined by the following Transact-SQL statement:

You use the following Transact-SQL script to insert new employee data into the table. Line numbers are included for reference only.


If an error occurs, you must report the error message and line number at which the error occurred and continue processing errors.
You need to complete the Transact-SQL script.
Which Transact-SQL segment should you insert at line 06?
A. SELECT ERROR_LINE(), ERROR_MESSAGE()
B. DECLARE @message NVARCHAR(1000),@severity INT, @state INT;
SELECT @message = ERROR_MESSAGE(), @severity = ERROR_SEVERITY(), @state = ERROR_STATE();
RAISERROR (@message, @severity, @state);
C. DECLARE @message NVARCHAR(1000),@severity INT, @state INT;
SELECT @message = ERROR_MESSAGE(), @severity = ERROR_SEVERITY(), @state = ERROR_STATE();
THROW (@message, @severity, @state);
D. THROW;

microsoft-exams

One thought on “Which Transact-SQL segment should you insert at line 06?

  1. Correct is A. It reports error line number and continues processing.
    Other answer do not report error line number.

Leave a Reply

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


The reCAPTCHA verification period has expired. Please reload the page.