sysmail_help_profile_sp (Transact-SQL)

 

THIS TOPIC APPLIES TO:yesSQL Server (starting with 2008)noAzure SQL DatabasenoAzure SQL Data Warehouse noParallel Data Warehouse

Lists information about one or more mail profiles.

Applies to: SQL Server (SQL Server 2008 through current version).

Topic link icon Transact-SQL Syntax Conventions

  
sysmail_help_profile_sp  [   [ @profile_id = ] profile_id | [ @profile_name = ] 'profile_name' ]  

[ @profile_id = ] profile_id
The profile id to return information for. profile_id is int, with a default of NULL.

[ @profile_name = ] 'profile_name'
The profile name to return information for. profile_name is sysname, with a default of NULL.

0 (success) or 1 (failure)

Returns a result set with the following columns.

Column nameData typeDescription
profile_idintThe profile id for the profile.
namesysnameThe profile name for the profile.
descriptionnvarchar(256)The description for the profile.

When a profile name or profile id is specified, sysmail_help_profile_sp returns information about that profile. Otherwise, sysmail_help_profile_sp returns information about every profile in the SQL Server instance.

The stored procedure sysmail_help_profile_sp is in the msdb database and is owned by the dbo schema. The procedure must be executed with a three-part name if the current database is not msdb.

Execute permissions for this procedure default to members of the sysadmin fixed server role.

A. Listing all profiles

The following example shows listing all profiles in the instance.

EXECUTE msdb.dbo.sysmail_help_profile_sp;  

Here is a sample result set, reformatted for line length:

profile_id  name                          description  
----------- ----------------------------- ------------------------------  
56          AdventureWorks Administrator  Administrative mail profile.    
57          AdventureWorks Operator       Operator mail profile.          

B. Listing a specific profile

The following example shows listing information for the profile AdventureWorks Administrator.

EXECUTE msdb.dbo.sysmail_help_profile_sp  
    @profile_name = 'AdventureWorks Administrator' ;  

Here is a sample result set, reformatted for line length:

profile_id  name                          description  
----------- ----------------------------- ------------------------------  
56          AdventureWorks Administrator  Administrative mail profile.    

Database Mail
Database Mail Stored Procedures (Transact-SQL)

Community Additions

ADD
Show: