sp_dropmessage

Transact-SQL Reference

Transact-SQL Reference

sp_dropmessage

Drops a specified error message from the sysmessages system table.

Syntax

sp_dropmessage [ @msgnum = ] message_number
    
[ , [ @lang = ] 'language' ]

Arguments

[@msgnum =] message_number

Is the message number to drop. message_number must be a user-defined message with a message number greater than 50000. message_number is int, with a default of NULL.

[@lang =] 'language'

Is the language of the message to drop. If all is specified, all language versions of message_number are dropped. language is sysname, with a default of NULL.

Return Code Values

0 (success) or 1 (failure)

Result Sets

None

Permissions

Only members of the sysadmin and serveradmin fixed server roles can execute this procedure.

Examples

This example drops the message (number 50001) from sysmessages.

USE master
EXEC sp_dropmessage 50001

Here is the result:

Message dropped.

See Also

CREATE TABLE

RAISERROR

sp_addmessage

sp_altermessage

System Stored Procedures