Hi friends, in this blog of SQL Server system stored procedure we will continue with another database mail stored procedure sysmail_help_principalprofile_sp.
Sysmail_help_principalprofile_sp stored procedure list the information about associations between database mail profile and database principals.
When sysmail_help_principalprofile_sp stored procedure is executed without any parameters then it returned lists all of the associations in the instance of SQL Server.
Syntax
sysmail_help_principalprofile_sp [ { [ @principal_id = ] principal_id | [ @principal_name = ] 'principal_name' } ] [ [ , ] { [ @profile_id = ] profile_id | [ @profile_name = ] 'profile_name' } ]
Arguments
@principal_Id – ID of the database user or role in msdb database.
@principal_name – Name of the database user or role in msdb database. Either @principal_id or @principal_name is necessary to specify.
@profile_id – Id of the database mail profile.
@profile_name – Name of the database mail profile. Either @profile_id or @profile_name must be specified.
Now let’s execute the below stored procedure by passing database profile name in parameters:
EXEC msdb.dbo.sysmail_help_principalprofile_sp@profile_name = 'Database Test Mail'
Similarly when we executed this stored procedure without passing any parameters it will return list of all association in instance of SQL Server.
EXEC msdb.dbo.sysmail_help_principalprofile_sp
That’s all friends for the day 🙂
Regards,
Kapil Singh
Like us on FaceBook | Join the fastest growing SQL Server group on FaceBook