Stored Procedure

Drop user-defined message from sys.messages table using stored procedure sp_dropmessage

Hi friends, today you will learn about how to drop user-defined message from sys.messages table using stored procedure sp_dropmessage.

Sp_dropmessage stored procedure is used to drop user-defined error message. It requires membership in sysadmin and serveradmin server roles.

Syntax of sp_dropmessage  is as follows:

Sp_dropmessage [@msgnum =] msgid,

[@lang =] ‘language’

Arguments

@msgnum is the Id of the message having datatype Int. Msg_id must be unique along with the combination of language.

@lang is the language of the message which specifies in which language message is written.

In previous blog we have added a user-defined message here.

Now, we will drop that previously added message using sp_dropmessage:

EXEC sp_dropmessage 50001,’us_english’

When we will check in table sys.messages that entry was removed.

That’s all folks for the day. Hope you like the post.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s