Events
Mar 31, 11 PM - Apr 2, 11 PM
The biggest SQL, Fabric and Power BI learning event. March 31 – April 2. Use code FABINSIDER to save $400.
Register todayThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Applies to:
SQL Server
Azure SQL Managed Instance
Deletes a Database Mail SMTP account. You can also use the Database Mail Configuration Wizard to delete an account.
Transact-SQL syntax conventions
sysmail_delete_account_sp { [ @account_id = ] account_id | [ @account_name = ] 'account_name' }
[ ; ]
The ID number of the account to delete. @account_id is int, with no default. Either @account_id or @account_name must be specified.
The name of the account to delete. @account_name is sysname, with no default. Either @account_id or @account_name must be specified.
0
(success) or 1
(failure).
None.
This procedure deletes the account specified, regardless of whether the account is in use by a profile. A profile that contains no accounts can't successfully send e-mail.
The stored procedure sysmail_delete_account_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 isn't msdb
.
You can grant EXECUTE
permissions on this procedure, but these permissions might be overridden during a SQL Server upgrade.
The following example shows deleting the Database Mail account named AdventureWorks Administrator
.
EXEC msdb.dbo.sysmail_delete_account_sp
@account_name = 'AdventureWorks Administrator';
Events
Mar 31, 11 PM - Apr 2, 11 PM
The biggest SQL, Fabric and Power BI learning event. March 31 – April 2. Use code FABINSIDER to save $400.
Register today