CREATE MESSAGE Statement [T-SQL]

Adds a user-defined message to the SYSUSERMESSAGES system table for use by PRINT and RAISERROR statements.

Syntax

CREATE MESSAGE message-number
... AS 'message-text'

Parameters

Usage

CREATE MESSAGE associates a message number with a message string. The message number can be used in PRINT and RAISERROR statements.

There is no parameter corresponding to the language argument for sp_addmessage.

Side Effects
  • Automatic commit

Standards

  • SQL—Vendor extension to ISO/ANSI SQL grammar.

  • Sybase—The functionality of CREATE MESSAGE is provided by the sp_addmessage procedure in Adaptive Server Enterprise.

Permissions

Requires one of:
  • CREATE MESSAGE system privilege.
  • CREATE ANY OBJECT system privilege.
Related reference
PRINT Statement [T-SQL]
RAISERROR Statement [T-SQL]