Skip to content

Latest commit

 

History

History
79 lines (60 loc) · 3.39 KB

File metadata and controls

79 lines (60 loc) · 3.39 KB
title sysmail_delete_profile_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_profile_sp
sysmail_delete_profile_sp_TSQL
dev_langs
TSQL
helpviewer_keywords
sysmail_delete_profile_sp
ms.assetid 71998653-4a02-446d-b6f7-50646a29e8a2
caps.latest.revision 40
author JennieHubbard
ms.author jhubbard
manager jhubbard

sysmail_delete_profile_sp (Transact-SQL)

[!INCLUDEtsql-appliesto-ss2008-xxxx-xxxx-xxx_md]

Deletes a mail profile used by Database Mail.

Applies to: [!INCLUDEssNoVersion] ([!INCLUDEssKatmai] through current version).

Topic link icon Transact-SQL Syntax Conventions

Syntax

  
sysmail_delete_profile_sp  { [ @profile_id = ] profile_id | [ @profile_name = ] 'profile_name' }  

Arguments

[ @profile_id = ] profile_id
Is the profile id of the profile to be deleted. profile_id is int, with a default of NULL. Either profile_id or profile_name must be specified.

[ @profile_name = ] 'profile_name'
Is the name of the profile to be deleted. profile_name is sysname, with a default of NULL. Either profile_id or profile_name must be specified.

Return Code Values

0 (success) or 1 (failure)

Result Sets

None

Remarks

Deleting a profile does not delete the accounts used by the profile.

This stored procedure deletes the profile regardless of whether users have access to the profile. Use caution when removing the default private profile for a user or the default public profile for the msdb database. When no default profile is available, sp_send_dbmail requires the name of a profile as an argument. Therefore, removing a default profile may cause calls to sp_send_dbmail to fail. For more information, see sp_send_dbmail (Transact-SQL).

The stored procedure sysmail_delete_profile_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 profile named AdventureWorks Administrator.

EXECUTE msdb.dbo.sysmail_delete_profile_sp  
    @profile_name = 'AdventureWorks Administrator' ;  

See Also

Database Mail
Database Mail Configuration Objects
Database Mail Stored Procedures (Transact-SQL)