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… Continue reading Drop user-defined message from sys.messages table using stored procedure sp_dropmessage

Stored Procedure

Add user-defined message in sys.message table using stored procedure sp_addmessage

Hi friends, today you will learn about how to add user-defined message in sys.messages table using stored procedure sp_addmessage. Sp_addmessage stored procedure is used to add user-defined error message  which can be viewed using sys.messages table. It requires membership in sysadmin and serveradmin server roles. Syntax of sp_Addmessage is as follows: sp_addmessage [ @msgnum= ]… Continue reading Add user-defined message in sys.message table using stored procedure sp_addmessage

Development

Difference between RAISERROR AND THROW in SQL Server

Hi friends, in SQL Server 2008 and earlier version we can define error handling using RAISERROR command. While later in SQL Server 2012 a new command was introduced THROW for error handling. Syntax for RAISERROR is as follows: RAISERROR ( { msg_id | msg_str | @local_variable } { ,severity ,state } [ ,argument [ ,…n… Continue reading Difference between RAISERROR AND THROW in SQL Server

Stored Procedure

Create user-defined datatype using sp_addtype Stored procedure in SQL Server

Hi friends, today in SQL Server System Stored procedure you will learn how to create user-defined datatype using stored procedure sp_addtype. Sp_addtype is used to provide an alias to datatype. You can find the find the information of the newly created user-defined datatype in sys.types table for a specific database. To get enable user-defined datatype… Continue reading Create user-defined datatype using sp_addtype Stored procedure in SQL Server