What is @@ERROR Variable in SQL SERVER?

What is @@ERROR Variable in SQL SERVER?
Why it is used in SQL Server stored Procedures?


Views: 5453 | Community Opinion: 2

Tags..  SQL Server  DBA  Asp.Net Interview  Database

Bookmark this page..



Ask a New Question Go to Home

Community Opinion/Answers
 
Rita Sahnu Said..

The @@ERROR automatic variable in SQL SERVER returns the error code of the last Transact-SQL statement. If there was no error, @@ERROR returns zero. Because @@ERROR 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.




Jothi Said..

@@Error - raised by the sql server itself
RaiseError - custom error written by the user. .......................................................................................-........................................................................................................................................................................................................................................






What do you think? Add your opinion/answer
*Name
*your opinion/answer: