sp_getmessage

Retrieves stored message strings from sysmessages and sysusermessages for print and raiserror statements.

Syntax

sp_getmessage message_num, result output [, language]

Parameters

Examples

Usage

Any application can use sp_getmessage, and any user can read the messages stored in sysmessages and sysusermessages.

See also

print, raiserror in Reference Manual: Commands.

Permissions

Any user can execute sp_getmessage. Permission checks do not differ based on the granular permissions settings.

Auditing

Values in event and extrainfo columns from the sysaudits table are:

InformationValues
Event

38

Audit option

exec_procedure

Command or access audited

Execution of a procedure

Information in extrainfo
  • Roles – Current active roles

  • Keywords or options – NULL

  • Previous value – NULL

  • Current value – NULL

  • Other information – All input parameters

  • Proxy information – Original login name, if set proxy in effect

Related reference
sp_addmessage
sp_dropmessage