In SQL Server, you can use the sysmail_delete_profileaccount_sp
stored procedure to remove a Database Mail account from a profile.
You can remove the account from a specific profile, or you can remove it from all profiles. You can also remove all accounts from a given profile.
The way it works is, you provide two arguments; the account name or its ID, and the profile name or its ID. If you omit the argument for the profile, the account is removed from all profiles. If you omit the argument for the account, then all accounts are removed from the profile.
Continue reading