This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
You're writing some error handling in a T-SQL script. If a problem arises, you want to raise an error with a severity of 20. Which command would you use to for this type of error handling?
THROW
RAISERROR
@@ERROR
How can you THROW outside of a CATCH block?
With arguments that raise a user-defined error.
With a conditional EXCEPTION clause
With a RAISERROR argument.
In what situation would you use @@ERROR?
To throw an error code.
To trigger an alert
To capture the last error code.
You must answer all questions before checking your work.
Was this page helpful?
Need help with this topic?
Want to try using Ask Learn to clarify or guide you through this topic?