O'Reilly logo

Microsoft® SQL Server 2012 Unleashed by Alex T. Silverstein, Chris Gallelli, Paul T. Bertucci, Ray Rankins

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using T-SQL to Update and Delete Mail Objects

To delete or update profiles, accounts, profile-account associations, and profile security settings (note: do so in reverse order), you use the stored procedures shown in Table 12.1.

Image

TABLE 12.1 T-SQL Stored Procedures

For example, to delete a profile, you execute this:

exec msdb.dbo.sysmail_delete_profile_sp @profile_name='Undesireable Profile Name'

To update a profile’s security, changing it from the default to the nondefault profile, you execute the following:

exec msdb.dbo.sysmail_update_principalprofile_sp    @profile_name = 'Default ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required