En alguna ocasión me ha ocurrido que no he podido activar en el sistema de alertas del agente de SQL, el perfil de correo Database Mail. Sea como sea, por mas que le pinchaba sobre Database Mail, siempre me activaba SQLMail.

Para esas situaciones en las que el Management studio no quiere reaccionar, podemos hacerlo nosotros manualmente mediante el siguiente código T-SQL:

USE [msdb] GO EXEC msdb.dbo.sp_set_sqlagent_properties @email_save_in_sent_folder=1
GO EXEC master.dbo.xp_instance_regwrite N'HKEY_LOCAL_MACHINE',
N'SOFTWAREMicrosoftMSSQLServerSQLServerAgent', N'UseDatabaseMail',
N'REG_DWORD', 1 GO EXEC master.dbo.xp_instance_regwrite N'HKEY_LOCAL_MACHINE',
 N'SOFTWAREMicrosoftMSSQLServerSQLServerAgent',  N'DatabaseMailProfile',
N'REG_SZ',  N'solid' GO

En este caso, donde pone “solid” pondremos el perfil Database Mail que queramos utilizar.

Enrique Catalá

Microsoft MVP & SolidQ Technical Leader at SolidQ
I´m technical leader at SolidQ, Microsoft Data Platform MVP,Computer engineer graduated with honors and Microsoft Certified Trainer (MCT). I am focused on the SQL Server relational engine and I am passionate on solving performance problems and scalability in OLTP systems.

I also works with the definition and implementation of reliable high availability environments, where I have successfully led more than 100 projects not only in Spain but in different countries like USA, Netherlands, Mexico, etc. I am the principal architect of the solutions called HealthCheck, QueryAnalytics and DatabaseObfuscator... I wrote the book "Planning for migration to SQL Server SQL Server 2008 R2" (ISBN : 978-84-936417-9-5).
Enrique Catalá