Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

sysmail_delete_account_sp (Transact-SQL)

Applies To: SQL Server 2014, SQL Server 2016 Preview

Topic Status: Some information in this topic is preview and subject to change in future releases. Preview information describes new features or changes to existing features in Microsoft SQL Server 2016 Community Technology Preview 2 (CTP2).

Deletes a Database Mail SMTP account. You can also use the Database Mail Configuration Wizard to delete an account.

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

Topic link icon Transact-SQL Syntax Conventions

sysmail_delete_account_sp { [ @account_id = ] account_id | [ @account_name = ] 'account_name' } 

[ @account_id = ] account_id

The ID number of the account to delete. account_id is int, with no default. Either account_id or account_name must be specified.

[ @account_name = ] 'account_name'

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)

This procedure deletes the account specified, regardless of whether the account is in use by a profile. A profile that contains no accounts cannot 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 is not msdb.

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

The following example shows deleting the Database Mail account named AdventureWorks Administrator.

EXECUTE msdb.dbo.sysmail_delete_account_sp
    @account_name = 'AdventureWorks Administrator' ;

Community Additions

© 2015 Microsoft