Sysmail_add_profile_sp – Day 12 – SQL Server System Stored Procedure

Hi friends, today in SQL Server System stored procedure series we will continue with database mail stored procedure sysmail_add_profile_sp.

Sysmail_add_profile_Sp stored procedure is used to create database mail profile. A database mail profile can hold multiple database mail accounts. Database mail profile name must be unique for Microsoft SQL Server Database Engine. This stored procedure is stored in msdb database and owned by schema dbo.

Syntax:

sysmail_add_profile_sp [ @profile_name = ] 'profile_name'
    [ , [ @description = ] 'description' ]
    [ , [ @profile_id = ] new_profile_id OUTPUT ]

Arguments:

@profile_name is the name of new database mail profile.

@description is the description for new profile having datatype nvarchar (256).

@profile_id is the ID of new profile having datatype int.

Let’s, execute the following code to create the new database mail profile:

EXECUTE msdb.dbo.sysmail_add_profile_sp

       @profile_name = 'Database Test Mail',

       @description = 'Profile for Test mail.';

So, a new database mail profile is created and we can check information related to this in stored procedure sysmail_help_profile_sp.

EXEC msdb.dbo.sysmail_help_profile_sp

sysmail_add_profile

That’s all for the day friends. We will continue with another database mail stored procedure in next post. Have a nice day 🙂

Regards,

Kapil Singh

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

Follow me on Twitter

Data Platform Virtual Summit 2020

Subscribe to SQLServerGeeks YouTube channel. If you want more learning content in your inbox, subscribe to SQLServerGeeks Bulletin.

SQLServerGeeks YouTube | SQLServerGeeks Bulletin | SQLServerGeeks Twitter

Avatar

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. Required fields are marked *