Sysmail_help_account_sp – Day 15 – SQL Server System Stored Procedure

Hi friends, in previous blog of SQL Server system stored procedure we created database mail account. In this blog we will learn how to get information about database mail account using stored procedure sysmail_hep_account_sp.

Sysmail_help_account_sp stored procedure displays information about database mail account.

When the procedure executes without passing any parameters then it will display all database accounts information.

Syntax of sysmail_help_account_Sp is as follows:

sysmail_help_account_sp [ [ @account_id = ] account_id | [ @account_name = ] 'account_name' ]

Arguments

@account_id – Account Id of the database mail account.

@account_name – Account name of the database mail account.

Let’s execute the stored procedure to get the information of the database mail account which we created in our previous blog here. Here we define the account name in the parameter list.

EXEC msdb.dbo.sysmail_help_Account_spNULL, 'DB_Email_Account'

sysmail_help_account

   

After executing the stored procedure we will get the following columns in the result set:

Account_Id – Account Id with datatype Int.

Name – Account Name with datatype sysname.

Description – Description of the account having datatype nvarchar(256).

Email_address – Email address of the sender having datatype nvarchar(128).

Display_name – Display name of the account having datatype nvarchar(128).

Replyto_address – The address where replies to message are sent.

Servertype – Type of email server for mail account.

Servername – Name of email server

Port – Port number of email server

Username – Username to use login to email server.

User_default_credentials – Specifies whether to send the email using SMTP server using credentials of SQL Server database engine.

Enable_ssl – Specifies whether Database email encrypts communication using SSL.

That’s all for the day friends. We will continue with other database mail stored procedures in next blogs. Have a happy learning 🙂

   

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.