sp_add_operator (Transact-SQL)

Uyarılar ve işleri için bir işleç (bildirim alıcı) oluşturur.

Topic link iconTransact-SQL sözdizimi kuralları

sp_add_operator [ @name = ] 'name' 
     [ , [ @enabled = ] enabled ] 
     [ , [ @email_address = ] 'email_address' ] 
     [ , [ @pager_address = ] 'pager_address' ] 
     [ , [ @weekday_pager_start_time = ] weekday_pager_start_time ] 
     [ , [ @weekday_pager_end_time = ] weekday_pager_end_time ] 
     [ , [ @saturday_pager_start_time = ] saturday_pager_start_time ] 
     [ , [ @saturday_pager_end_time = ] saturday_pager_end_time ] 
     [ , [ @sunday_pager_start_time = ] sunday_pager_start_time ] 
     [ , [ @sunday_pager_end_time = ] sunday_pager_end_time ] 
     [ , [ @pager_days = ] pager_days ] 
     [ , [ @netsend_address = ] 'netsend_address' ] 
     [ , [ @category_name = ] 'category' ] 

Bağımsız değişkenler

  • [ @name= ] 'name'
    Bir işleç (bildirim alıcı) adı.This name must be unique and cannot contain the percent (%) character.name is sysname, with no default.

  • [ @enabled= ] enabled
    Indicates the current status of the operator.enabled is tinyint, with a default of 1 (enabled).If 0, işleç, etkin değildir ve bildirimleri almaz.

  • [ @email_address= ] 'email_address'
    Işleç e-posta adresi.This string is passed directly to the e-mail system.email_address is nvarchar(100), with a default of NULL.

    Bir fiziksel bir e-posta adresi veya bir diğer ad belirtin email_address. Örneğin:

    'jdoe 'veya'jdoe@xyz.com'

    Not

    E-posta diğer ad ad adı, yalnızca SQL Mail için kullanabilirsiniz.Veritabanı posta için e-posta adresini kullanmanız gerekir.

  • [ @pager_address= ] 'pager_address'
    Işleç çağrı cihazı adresi.This string is passed directly to the e-mail system.pager_address is narchar(100), with a default of NULL.

  • [ @weekday_pager_start_time= ] weekday_pager_start_time
    The time after which SQL Server Agent sends pager notification to the specified operator on the weekdays, from Monday through Friday.weekday_pager_start_timeis int, with a default of 090000, which indicates 9:00 A.M.on a 24-hour clock, and must be entered using the form HHMMSS.

  • [ @weekday_pager_end_time= ] weekday_pager_end_time
    The time after which SQLServerAgent service no longer sends pager notification to the specified operator on the weekdays, from Monday through Friday.weekday_pager_end_timeis int, with a default of 180000, which indicates 6:00 P.M.on a 24-hour clock, and must be entered using the form HHMMSS.

  • [ @saturday_pager_start_time =] saturday_pager_start_time
    The time after which SQLServerAgent service sends pager notification to the specified operator on Saturdays.saturday_pager_start_time is int, with a default of 090000, which indicates 9:00 A.M.on a 24-hour clock, and must be entered using the form HHMMSS.

  • [ @saturday_pager_end_time= ] saturday_pager_end_time
    The time after which SQLServerAgent service no longer sends pager notification to the specified operator on Saturdays.saturday_pager_end_timeis int, with a default of 180000, which indicates 6:00 P.M.on a 24-hour clock, and must be entered using the form HHMMSS.

  • [ @sunday_pager_start_time= ] sunday_pager_start_time
    The time after which SQLServerAgent service sends pager notification to the specified operator on Sundays.sunday_pager_start_timeis int, with a default of 090000, which indicates 9:00 A.M.on a 24-hour clock, and must be entered using the form HHMMSS.

  • [ @sunday_pager_end_time =] sunday_pager_end_time
    The time after which SQLServerAgent service no longer sends pager notification to the specified operator on Sundays.sunday_pager_end_timeis int, with a default of 180000, which indicates 6:00 P.M.on a 24-hour clock, and must be entered using the form HHMMSS.

  • [ @pager_days= ] pager_days
    Is a number that indicates the days that the operator is available for pages (subject to the specified start/end times).pager_daysis tinyint, with a default of 0 indicating the operator is never available to receive a page.Valid values are from 0 through 127.pager_daysis calculated by adding the individual values for the required days.Örneğin, Pazartesi'den Cuma'ya olur. 2+4+8+16+32 = 62.Aşağıdaki tabloda, haftanın her günü için değerini listeler.

    Değer

    Açıklama

    1

    Pazar

    2

    Pazartesi

    4

    Salı

    8

    Çarşamba

    16

    Perşembe

    32

    Cuma

    64

    Cumartesi

  • [ @netsend_address= ] 'netsend_address'
    The network address of the operator to whom the network message is sent.netsend_addressis nvarchar(100), with a default of NULL.

  • [ @category_name= ] 'category'
    The name of the category for this operator.category is sysname, with a default of NULL.

Dönüş Kodu Değerleri

0 (başarılı) veya 1 (hata)

Sonuç Kümeleri

None

Remarks

sp_add_operator çalıştırılmalıdır.msdb veritabanıdır.

Disk belleği, disk belleği kullanmak isterseniz, bir e-posta-için-çağrı cihazı özelliği olmalıdır e-posta sistemi tarafından desteklenmiyor.

SQL Server Management Studio işleri yönetmek için kolay ve grafiksel bir yol sunar ve oluşturmak ve iş alt yapısı'nı yönetmek için önerilen yöntemdir.

İzinler

Yalnızca üyeleri sysadmin sabit sunucu rolü çalıştırabilirsinizsp_add_operator.

Örnekler

işleç bilgi için aşağıdaki örnek ayarlar danwi. Işleç etkinleştirildi.SQL Server Agent sends notifications by pager from Monday through Friday from 8 A.M.to 5 P.M.

USE msdb ;
GO

EXEC dbo.sp_add_operator
    @name = N'Dan Wilson',
    @enabled = 1,
    @email_address = N'danwi',
    @pager_address = N'5551290AW@pager.Adventure-Works.com',
    @weekday_pager_start_time = 080000,
    @weekday_pager_end_time = 170000,
    @pager_days = 62 ;
GO