🎴 Flashcard Mode

SQL Server Advanced Concepts

Card1 / 19
Mastered0
Review0
QuestionClick to flip

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

AnswerClick to flip back
A
True
💡 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.

Change Mode