Drop User Defined Error Message In SQL Server 2008

In this article I demonstrate how to drop user defined error message using system stored procedure.
  • 1827

In this article I demonstrate how to drop user defined error message using system stored procedure i.e. sp_dropmessage . The sp_dropmessage is used to drop user-added message. In my previous article I describe how to create user defined error message. You van visit from here: Creating User Defined Error Message In SQL Server 2008.

Syntax

sp_dropmessage[@msgnum = ]message_number

[,[@lang = ]'language']

Here message_number is the message number of user-defined error message, language is the language of message which you want to drop.

Example:

To drop the user-defined error message with message ID 400021 created in my previous article.

exec sp_dropmessage 400021

Output:

drop-UserMessage.jpg

How It Works

In given example user-defined error message is dropped using the sp_dropmessage system stored procedure. Only user-defined error message could be dropped using sp_dropmessage stored procedure, whose message ID is  between 50,001 and 2,147,483,647.

Categories

More Articles

© 2019 DotNetHeaven. All rights reserved.