THROW vs. RAISERROR
According to the Differences Between RAISERROR
and THROW
in Sql Server:
Both
RAISERROR
andTHROW
statements are used to raise an error in Sql Server.The journey of
RAISERROR
started from Sql Server 7.0; whereas the journey of theTHROW
statement has just begun with Sql Server 2012.Microsoft is suggesting we start using the
THROW
statement instead ofRAISERROR
. TheTHROW
statement seems to be simpler and easier to use thanRAISERROR
.
Yes, it is, but only since 2012. If you're using 2008R2, then it didn't exist.
The definitions of state and severity are clearly documented in the raiserror documentation