Saturday, 31 July 2010

@@ERROR

@@ERROR gets an error number when every Transact-SQL statement completes, process @@ERROR in one of two ways:

1) Test or use @@ERROR immediately after the Transact-SQL statement.
2) Save @@ERROR in an integer variable immediately after the Transact-SQL statement completes. The value of the variable can be used later.