SQLConfiguration SQLConfiguration

Transactions Locks «Prev 


Applies To: SQL Server 2014, SQL Server 2016 Preview
Generates an error message and initiates error processing for the session. RAISERROR can either reference a user-defined message stored in the sys.messages catalog view or build a message dynamically. The message is returned as a server error message to the calling application or to an associated CATCH block of a
construct. New applications should use THROW instead.
Applies to: SQL Server (SQL Server 2008 through current version), Azure SQL Database, Azure SQL Data Warehouse Public Preview.

MESSAGE_ID is a user defined message number. All user-defined messages are stored in the sysmessages table. The message number should be greater than 50,000. The message stored in the sysmessages table can be formatted.

message_string is a string of text to report back to the calling application or procedure. This is used in place of looking up the message text in the sysmessages table. If this option is used, an error message of 50000 is automatically used.

severity is the category level of error. The severity can be any of the following:

State is an arbitrary value that you select (from 1 to 127) to further identify the state of your error.

argument is one or more arguments that can be used in formatting the message. If the message_ID parameter is used.

option is one of the following : 1) Logs the error in the application log and the server log 2) NOWAIT: Sends messages immediately (asynchronously) to the client. It does not wait for processing to finish. 3) SETERROR: Set the @@ERROR global variable, regardless of the severity level specified.