| 1 |
Category
For example, -- the Severity Level is considered a Fatal Error for levels 19 to 25.
|
-- Level 19
USE [msdb]
GO
EXEC msdb.dbo.sp_add_alert @name=N'Severity
19 Error',
@message_id=0,
@severity=19,
@enabled=1,
@delay_between_responses=180,
@include_event_description_in=7,
@category_name=N'[Uncategorized]',
@job_id=N'00000000-0000-0000-0000-000000000000'
GO
EXEC msdb.dbo.sp_add_notification
@alert_name=N'Severity 19 Error',
@operator_name=N'DBATeam',
@notification_method =1
GO
-- Level 20
EXEC msdb.dbo.sp_add_alert @name=N'Severity
20 Error',
@message_id=0,
@severity=20,
@enabled=1,
@delay_between_responses=180,
@include_event_description_in=7,
@category_name=N'[Uncategorized]',
@job_id=N'00000000-0000-0000-0000-000000000000'
GO
EXEC msdb.dbo.sp_add_notification
@alert_name=N'Severity 20 Error',
@operator_name=N'DBATeam',
@notification_method =1
GO
-- Level 21
EXEC msdb.dbo.sp_add_alert @name=N'Severity
21 Error',
@message_id=0,
@severity=21,
@enabled=1,
@delay_between_responses=180,
@include_event_description_in=7,
@category_name=N'[Uncategorized]',
@job_id=N'00000000-0000-0000-0000-000000000000'
GO
EXEC msdb.dbo.sp_add_notification
@alert_name=N'Severity 21 Error',
@operator_name=N'DBATeam',
@notification_method =1
GO
-- Level 22
EXEC msdb.dbo.sp_add_alert @name=N'Severity
22 Error',
@message_id=0,
@severity=22,
@enabled=1,
@delay_between_responses=180,
@include_event_description_in=7,
@category_name=N'[Uncategorized]',
@job_id=N'00000000-0000-0000-0000-000000000000'
GO
EXEC msdb.dbo.sp_add_notification
@alert_name=N'Severity 22 Error',
@operator_name=N'DBATeam',
@notification_method =1
GO
-- Level 23
EXEC msdb.dbo.sp_add_alert @name=N'Severity
23 Error',
@message_id=0,
@severity=23,
@enabled=1,
@delay_between_responses=180,
@include_event_description_in=7,
@category_name=N'[Uncategorized]',
@job_id=N'00000000-0000-0000-0000-000000000000'
GO
EXEC msdb.dbo.sp_add_notification
@alert_name=N'Severity 23 Error',
@operator_name=N'DBATeam',
@notification_method =1
GO
-- Level 24
EXEC msdb.dbo.sp_add_alert @name=N'Severity
24 Error',
@message_id=0,
@severity=24,
@enabled=1,
@delay_between_responses=180,
@include_event_description_in=7,
@category_name=N'[Uncategorized]',
@job_id=N'00000000-0000-0000-0000-000000000000'
GO
EXEC msdb.dbo.sp_add_notification
@alert_name=N'Severity 24 Error',
@operator_name=N'DBATeam',
@notification_method =1
GO
-- Level 25
EXEC msdb.dbo.sp_add_alert @name=N'Severity
25 Error',
@message_id=0,
@severity=25,
@enabled=1,
@delay_between_responses=180,
@include_event_description_in=7,
@category_name=N'[Uncategorized]',
@job_id=N'00000000-0000-0000-0000-000000000000'
GO
EXEC msdb.dbo.sp_add_notification
@alert_name=N'Severity 25 Error',
@operator_name=N'DBATeam',
@notification_method =1
GO
|
| 2 |
Keyword
For example, 'Primary Filegroup is full' when the database can no longer allocate space for the database.
|
USE [msdb]
GO
EXEC msdb.dbo.sp_add_alert @name=N'Keyword
- Primary Filegroup is full',
@message_id=0,
@severity=1,
@enabled=1,
@delay_between_responses=180,
@include_event_description_in=7,
@event_description_keyword=N'Primary Filegroup is full',
@category_name=N'[Uncategorized]',
@job_id=N'00000000-0000-0000-0000-000000000000'
GO
EXEC msdb.dbo.sp_add_notification @alert_name=N'Keyword
- Primary Filegroup is full',
@operator_name=N'DBATeam',
@notification_method =1
GO
|
| 3 |
Error Number
For example, error 9100 related to index corruption.
|
USE [msdb]
GO
EXEC msdb.dbo.sp_add_alert @name=N'Error - 9100
(Index Corruption)',
@message_id=9100,
@severity=0,
@enabled=1,
@delay_between_responses=180,
@include_event_description_in=7,
@category_name=N'[Uncategorized]',
@job_id=N'00000000-0000-0000-0000-000000000000'
GO
EXEC msdb.dbo.sp_add_notification
@alert_name=N'Error - 9100
(Index Corruption)',
@operator_name=N'DBATeam',
@notification_method =1
GO
|