Sp_dropmessage – Day 8 – SQL Server System Stored Procedure

Hi friends, today in SQL Server system stored procedure series 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_dropmessage50001,'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.

Regards,

Kapil Singh

Like us on FaceBook | Join the fastest growing SQL Server group on FaceBook 

Follow me on Twitter

   

About Kapil Singh Kumawat

Kapil Singh Kumawat has been working with SQL Server since last 5 years. He is from Jaipur, Rajasthan, India and currently working with Cognizant Technology Solutions as SQL Server Developer. He has good experience in performance tuning, SSIS, data migration and data designing. Apart from database he has interest in travelling, watching football and listening music.

View all posts by Kapil Singh Kumawat →

Leave a Reply

Your email address will not be published.