Development · Stored Procedure

Sysmail_help_profile_sp – SQL Server Database Mail Stored Procedure – Part 4

Hi friends, today we will learn how to get information about database mail profile using stored procedure sysmail_help_profile_sp.

Sysmail_help_profile_sp stored procedure provides information about the database mail profiles. This stored procedure is stored in msdb database and owned by dbo schema. The procedure must be executed with a three part name if current database is not msdb.

Syntax:

sysmail_help_profile_sp  [   [ @profile_id = ] profile_id | [ @profile_name = ] ‘profile_name’ ]

Arguments:

@profile_id  is the id of database mail profile with default value NULL.

@profile_name is the name of the database mail profile.

When profile_id or profile_name is specified, sysmail_help_profile_sp stored procedure return information about that profile. If a profile_id or profile_name is not specified it returns information about all profiles in current SQL Server instance.

In our previous blog we created a database mail profile with name ‘Database Test Mail’. Now we will pass that profile name in the parameter to retrieve information about that profile.

EXEC msdb.dbo.sysmail_help_profile_sp @profile_name = ‘Database Test Mail’

sysmail_help_profile

Here, in result set we get information of that database mail profile.

Profile_id – Profile id of database mail profile.

Name – Name of database mail profile.

Description – Description about database mail profile.

That’s all folks for the day. In next blog we will see how to update the information about database mail profile. Have a nice day 🙂

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