What is @?

The @ automatic variable returns the error code of the last Transact-SQL statement.

If there was no error, @ returns zero.

Because @ is reset after each Transact-SQL statement, it must be saved to a variable if it is needed to process it further after checking it.

Author:

Since March 2011, have 8+ years of professional experience on software development, currently working as Senior Software Engineer at s3 Innovate Pte Ltd.

Leave a Reply