--- title: "sysmail_delete_account_sp (Transact-SQL) | Microsoft Docs" ms.custom: "" ms.date: "03/14/2017" ms.prod: "sql-non-specified" ms.reviewer: "" ms.suite: "" ms.technology: - "database-engine" ms.tgt_pltfrm: "" ms.topic: "language-reference" f1_keywords: - "sysmail_delete_account_sp" - "sysmail_delete_account_sp_TSQL" dev_langs: - "TSQL" helpviewer_keywords: - "sysmail_delete_account_sp" ms.assetid: 2adcac78-4a4a-407e-9666-1d9c43c73cc2 caps.latest.revision: 40 author: "JennieHubbard" ms.author: "jhubbard" manager: "jhubbard" --- # sysmail_delete_account_sp (Transact-SQL) [!INCLUDE[tsql-appliesto-ss2008-xxxx-xxxx-xxx_md](../../includes/tsql-appliesto-ss2008-xxxx-xxxx-xxx-md.md)] Deletes a Database Mail SMTP account. You can also use the Database Mail Configuration Wizard to delete an account. || |-| |**Applies to**: [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] ([!INCLUDE[ssKatmai](../../includes/sskatmai-md.md)] through [current version](http://go.microsoft.com/fwlink/p/?LinkId=299658)).| ![Topic link icon](../../database-engine/configure-windows/media/topic-link.gif "Topic link icon") [Transact-SQL Syntax Conventions](../../t-sql/language-elements/transact-sql-syntax-conventions-transact-sql.md) ## Syntax ``` sysmail_delete_account_sp { [ @account_id = ] account_id | [ @account_name = ] 'account_name' } ``` ## Arguments [ **@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. ## Return Code Values **0** (success) or **1** (failure) ## Result Sets None ## Remarks 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**. ## Permissions Execute permissions for this procedure default to members of the **sysadmin** fixed server role. ## Examples The following example shows deleting the Database Mail account named `AdventureWorks Administrator`. ``` EXECUTE msdb.dbo.sysmail_delete_account_sp @account_name = 'AdventureWorks Administrator' ; ``` ## See Also [Database Mail](../../relational-databases/database-mail/database-mail.md) [Create a Database Mail Account](../../relational-databases/database-mail/create-a-database-mail-account.md) [Database Mail Configuration Objects](../../relational-databases/database-mail/database-mail-configuration-objects.md) [sysmail_add_account_sp (Transact-SQL)](../../relational-databases/system-stored-procedures/sysmail-add-account-sp-transact-sql.md) [sysmail_delete_profile_sp (Transact-SQL)](../../relational-databases/system-stored-procedures/sysmail-delete-profile-sp-transact-sql.md) [sysmail_delete_profileaccount_sp (Transact-SQL)](../../relational-databases/system-stored-procedures/sysmail-delete-profileaccount-sp-transact-sql.md) [sysmail_help_account_sp (Transact-SQL)](../../relational-databases/system-stored-procedures/sysmail-help-account-sp-transact-sql.md) [sysmail_help_profile_sp (Transact-SQL)](../../relational-databases/system-stored-procedures/sysmail-help-profile-sp-transact-sql.md) [sysmail_help_profileaccount_sp (Transact-SQL)](../../relational-databases/system-stored-procedures/sysmail-help-profileaccount-sp-transact-sql.md) [sysmail_update_profileaccount_sp (Transact-SQL)](../../relational-databases/system-stored-procedures/sysmail-update-profileaccount-sp-transact-sql.md)