sp_update_operator (Transact-SQL)

Aktualizuje informacje o operator (powiadomienie adresata) do użycia z alertów i zadania.

Topic link iconKonwencje składni języka Transact-SQL

sp_update_operator 
     [@name =] 'name' 
     [ , [@new_name =] 'new_name'] 
     [ , [@enabled =] enabled] 
     [ , [@email_address =] 'email_address']
     [ , [@pager_address =] 'pager_number'] 
     [ , [@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']

Argumenty

  • [ @name =] 'name'
    The name of the operator to modify.name is sysname, with no default.

  • [ @new_name =] 'new_name'
    Nowa nazwa dla operator.This name must be unique.new_name is sysname, with a default of NULL.

  • [ @enabled =] enabled
    A number indicating the operator's current status (1 if currently enabled, 0 if not).enabled is tinyint, with a default of NULL.Jeśli nie jest włączona, nie otrzyma operator alert powiadomienia.

  • [ @email_address =] 'email_address'
    Adres e-mail operator.This string is passed directly to the e-mail system.email_address is nvarchar(100), with a default of NULL.

  • [ @pager_address =] 'pager_number'
    Adres pager operator.This string is passed directly to the e-mail system.pager_number is nvarchar(100), with a default of NULL.

  • [ @weekday_pager_start_time =] weekday_pager_start_time
    Specifies the time after which a pager notification can be sent to this operator, from Monday through Friday.weekday_pager_start_timeis int, with a default of NULL, and must be entered in the form HHMMSS for use with a 24-hour clock.

  • [ @weekday_pager_end_time =] weekday_pager_end_time
    Specifies the time after which a pager notification cannot be sent to the specified operator, from Monday through Friday.weekday_pager_end_timeis int, with a default of NULL, and must be entered in the form HHMMSS for use with a 24-hour clock.

  • [ @saturday_pager_start_time =] saturday_pager_start_time
    Specifies the time after which a pager notification can be sent to the specified operator on Saturdays.saturday_pager_start_timeis int, with a default of NULL, and must be entered in the form HHMMSS for use with a 24-hour clock.

  • [ @saturday_pager_end_time =] saturday_pager_end_time
    Specifies the time after which a pager notification cannot be sent to the specified operator on Saturdays.saturday_pager_end_timeis int, with a default of NULL, and must be entered in the form HHMMSS for use with a 24-hour clock.

  • [ @sunday_pager_start_time =] sunday_pager_start_time
    Specifies the time after which a pager notification can be sent to the specified operator on Sundays.sunday_pager_start_timeis int, with a default of NULL, and must be entered in the form HHMMSS for use with a 24-hour clock.

  • [ @sunday_pager_end_time =] sunday_pager_end_time
    Specifies the time after which a pager notification cannot be sent to the specified operator on Sundays.sunday_pager_end_timeis int, with a default of NULL, and must be entered in the form HHMMSS for use with a 24-hour clock.

  • [ @pager_days =] pager_days
    Specifies the days that the operator is available to receive pages (subject to the specified start/end times).pager_daysis tinyint, with a default of NULL, and must be a value from 0 through 127.pager_days is calculated by adding the individual values for the required days.Na przykład od poniedziałku do piątku jest 2+4+8+16+32 = 64.

    Wartość

    Description

    1

    Niedziela

    2

    Poniedziałek

    4

    Wtorek

    8

    Środa

    16

    Czwartek

    32

    Piątek

    64

    Sobota

  • [ @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 alert.category is sysname, with a default of NULL.

Wartości kodów powrotnych

0 (sukces) lub 1 (brak)

Remarks

sp_update_operator musi być uruchamiane msdb bazy danych.

Uprawnienia

Uprawnienia do wykonać to ustawienie domyślne procedury, aby członkowie sysadmin stała rola serwera.

Przykłady

The following example updates the operator status to enabled, and sets the days (from Monday through Friday, from 8 A.M.through 5 P.M.) when the operator can be paged.

USE msdb ;
GO

EXEC dbo.sp_update_operator 
    @name = N'François Ajenstat',
    @enabled = 1,
    @email_address = N'françoisa',
    @pager_address = N'5551290AW@pager.Adventure-Works.com',
    @weekday_pager_start_time = 080000,
    @weekday_pager_end_time = 170000,
    @pager_days = 62 ;
GO