Setup MS SQL Server Alerts via TSQL
Published May 08, 2020 / by Chris Smith / Leave a CommentAmend TSQL to your environment, run the TSQL, restart the agent service and test (I find it easy to enter an incorrect username and password). USE [msdb] GO EXEC msdb.dbo.sp_set_sqlagent_properties @email_save_in_sent_folder=1, @databasemail_profile=N'<TSQL_MAIL_PROFILE>’, @use_databasemail=1 GO USE [msdb] GO EXEC msdb.dbo.sp_add_alert @name=N’Login Mismatch’, @message_id=18456, @severity=0, @enabled=1, @delay_between_responses=0, @include_event_description_in=1, @job_id=N’00000000-0000-0000-0000-000000000000’GO USE [msdb] […]