CREATE MESSAGE Statement [T-SQL]

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

Quick Links:

Go to Parameters

Go to Usage

Go to Standards

Go to Permissions

Syntax

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

Parameters

(back to top)

Usage

(back to top)

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

(back to top)

  • SQL—Vendor extension to ISO/ANSI SQL grammar.
  • SAP Sybase Database product—The functionality of CREATE MESSAGE is provided by the sp_addmessage procedure in Adaptive Server.

Permissions

(back to top)

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