Multiple choice technology databases

@@Error returns the sys.messages.message_id column value if an error occurs in the last T-SQL statement executed.True/False?

  1. True

  2. False

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

In SQL Server, @@ERROR returns the error number (which corresponds to message_id in sys.messages) of the last executed statement. If the statement executes successfully, it returns 0. Thus, when an error occurs, it directly yields that ID.