sp_add_notification(Transact-SQL)

경고에 대한 알림을 설정합니다.

항목 링크 아이콘 Transact-SQL 구문 표기 규칙

구문

sp_add_notification [ @alert_name = ] 'alert' , 
    [ @operator_name = ] 'operator' , 
    [ @notification_method = ] notification_method

인수

  • [ @alert_name= ] 'alert'
    이 알림에 대한 경고입니다. alert는 sysname이며 기본값은 없습니다.

  • [ @operator_name= ] 'operator'
    경고가 발생할 경우 알림을 받을 운영자입니다. operator는 sysname이며 기본값은 없습니다.

  • [ @notification_method= ] notification_method
    운영자에게 알림을 보내는 방법입니다. notification_method는 tinyint이며 기본값은 없습니다. notification_method에는 OR 논리 연산자와 함께 다음 값 중 하나 이상을 사용할 수 있습니다.

    설명

    1

    전자 메일

    2

    호출기

    4

    net send

반환 코드 값

0(성공) 또는 1(실패)

결과 집합

없음

주의

sp_add_notificationmsdb 데이터베이스에서 실행되어야 합니다.

SQL Server Management Studio는 그래픽 방식으로 전체 경고 시스템을 간편하게 관리할 수 있도록 해 줍니다. Management Studio를 사용하면 경고 인프라를 쉽게 구성할 수 있습니다.

경고에 대한 응답으로 알림을 보내려면 먼저 메일을 보낼 수 있도록 SQL Server 에이전트를 구성해야 합니다.

전자 메일 메시지 또는 호출기 알림을 전송하는 동안 오류가 발생하면 SQL Server 에이전트 서비스 오류 로그에 오류가 보고됩니다.

사용 권한

sysadmin 고정 서버 역할의 멤버만 sp_add_notification을 실행할 수 있습니다.

다음 예에서는 지정된 경고(Test Alert)에 전자 메일 알림을 추가합니다.

[!참고]

이 예에서는 Test Alert가 이미 존재하고 있으며 François Ajenstat가 유효한 운영자 이름이라고 가정합니다.

USE msdb ;
GO

EXEC dbo.sp_add_notification
 @alert_name = N'Test Alert',
 @operator_name = N'François Ajenstat',
 @notification_method = 1 ;
GO

참고 항목

참조

sp_delete_notification(Transact-SQL)

sp_help_notification(Transact-SQL)

sp_update_notification(Transact-SQL)

sp_add_operator(Transact-SQL)

시스템 저장 프로시저(Transact-SQL)