sp_update_alert (Transact-SQL)

Varolan uyarı ayarlarını güncelleştirir.

Topic link iconTransact-SQL sözdizimi kuralları

sp_update_alert 
     [ @name =] 'name' 
     [ , [ @new_name =] 'new_name'] 
     [ , [ @enabled =] enabled] 
     [ , [ @message_id =] message_id] 
     [ , [ @severity =] severity] 
     [ , [ @delay_between_responses =] delay_between_responses] 
     [ , [ @notification_message =] 'notification_message'] 
     [ , [ @include_event_description_in =] include_event_description_in] 
     [ , [ @database_name =] 'database'] 
     [ , [ @event_description_keyword =] 'event_description_keyword'] 
     [ , [ @job_id =] job_id | [@job_name =] 'job_name'] 
     [ , [ @occurrence_count = ] occurrence_count] 
     [ , [ @count_reset_date =] count_reset_date] 
     [ , [ @count_reset_time =] count_reset_time] 
     [ , [ @last_occurrence_date =] last_occurrence_date] 
     [ , [ @last_occurrence_time =] last_occurrence_time] 
     [ , [ @last_response_date =] last_response_date] 
     [ , [ @last_response_time =] last_response _time]
     [ , [ @raise_snmp_trap =] raise_snmp_trap]
     [ , [ @performance_condition =] 'performance_condition' ] 
     [ , [ @category_name =] 'category']
     [ , [ @wmi_namespace = ] 'wmi_namespace' ]
     [ , [ @wmi_query = ] 'wmi_query' ]

Bağımsız değişkenler

  • [ @name =] 'name'
    The name of the alert that is to be updated.name is sysname, with no default.

  • [ @new_name =] 'new_name'
    Uyarı için yeni BIR ad.The name must be unique.new_name is sysname, with a default of NULL.

  • [ @enabled =] enabled
    Specifies whether the alert is enabled (1) or not enabled (0).enabled is tinyint, with a default of NULL.uyarı harekete etkinleştirilmiş olmalıdır.

  • [ @message_id =] message_id
    Yeni BIR ileti veya hata numarası uyarı tanımı.Typically, message_id corresponds to an error number in the sysmessages table.message_id is int, with a default of NULL.Yalnızca uyarı önem düzey ayarı, BIR ileti KIMLIĞI kullanılabilir. 0.

  • [ @severity =] severity
    (Yeni BIR önem düzey 1 through 25) Uyarı tanımı.Any Microsoft SQL Server message sent to the Windows application log with the specified severity will activate the alert.severity is int, with a default of NULL.Uyarı iletisi KIMLIĞI ayarı ise BIR önem düzey kullanılabilir. 0.

  • [ @delay_between_responses =] delay_between_responses
    The new waiting period, in seconds, between responses to the alert.delay_between_responses is int, with a default of NULL.

  • [ @notification_message =] 'notification_message'
    The revised text of an additional message sent to the operator as part of the e-mail, net send, or pager notification.notification_message is nvarchar(512), with a default of NULL.

  • [ @include_event_description_in =] include_event_description_in
    Specifies whether the description of the SQL Server error from the Windows application log should be included in the notification message.include_event_description_in is tinyint, with a default of NULL, and can be one or more of these values.

    Değer

    Açıklama

    0

    None

    1

    E-posta

    2

    Çağrı cihazı

    4

    net send

    7

    Tümü

  • [ @database_name =] 'database'
    The name of the database in which the error must occur for the alert to fire.database is sysname. Names that are enclosed in brackets ([ ]) are not allowed.NULL varsayılan değerdir.

  • [ @event_description_keyword =] 'event_description_keyword'
    Hata günlüğüne hata iletisi açıklaması bulunamıyor gereken bir karakter dizisi.Transact-SQL LIKE expression pattern-matching characters can be used.event_description_keyword is nvarchar(100), with a default of NULL.Bu parametre, nesne adları (örneğin, süzmek için kullanışlıdır customer_table %).

  • [ @job_id =] job_id
    The job identification number.job_id is uniqueidentifier, with a default of NULL.If job_id , belirtilen job_name ihmal gerekir.

  • [ @job_name =] 'job_name'
    The name of the job that executes in response to this alert.job_name is sysname, with a default of NULL.If job_name , belirtilen job_id ihmal gerekir.

  • [ @occurrence_count = ] occurrence_count
    Resets the number of times the alert has occurred.occurrence_count is int, with a default of NULL, and can be set only to 0.

  • [ @count_reset_date =] count_reset_date
    Resets the date the occurrence count was last reset.count_reset_date is int, with a default of NULL.

  • [ @count_reset_time =] count_reset_time
    Resets the time the occurrence count was last reset.count_reset_time is int, with a default of NULL.

  • [ @last_occurrence_date =] last_occurrence_date
    Resets the date the alert last occurred.last_occurrence_date is int, with a default of NULL, and can be set only to 0.

  • [ @last_occurrence_time =] last_occurrence_time
    Resets the time the alert last occurred.last_occurrence_time is int, with a default of NULL, and can be set only to 0.

  • [ @last_response_date =] last_response_date
    Resets the date the alert was last responded to by the SQLServerAgent service.last_response_date is int, with a default of NULL, and can be set only to 0.

  • [ @last_response_time =] last_response_time
    Resets the time the alert was last responded to by the SQLServerAgent service.last_response_time is int, with a default of NULL, and can be set only to 0.

  • [ @raise_snmp_trap =] raise_snmp_trap
    Ayrılmış.

  • [ @performance_condition =] 'performance_condition'
    A value expressed in the format 'itemcomparatorvalue'.performance_condition is nvarchar(512), with a default of NULL, and consists of these elements.

    Biçim öğesi

    Açıklama

    Item

    Bir performans nesnesi, performans sayacı veya sayacı adlandırılmış örnek

    Comparator

    Bu işleçlerden birini: >, <, =

    Value

    Sayaç sayısal bir değer

  • [ @category_name =] 'category'
    The name of the alert category.category is sysname with a default of NULL.

  • [ @ wmi_namespace= ] 'wmi_namespace'
    The WMI namespace to query for events.wmi_namespace is sysname, with a default of NULL.

  • [ @ wmi_query= ] 'wmi_query'
    The query that specifies the WMI event for the alert.wmi_query is nvarchar(512), with a default of NULL.

Dönüş Kodu Değerleri

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

Remarks

veritabanı Sysmessages için yazılanMicrosoft Windows Uygulama günlüğüne bir uyarı harekete.

sp_update_alert yalnızca hangi parametresi için değerler sağlanan bu uyarı ayarlarını değiştirir.Parametre belirtilmezse, geçerli ayarı korunur.

İzinler

Bu saklı yordamı çalıştırmak için , kullanıcıların bir üyesi olmanız sysadmin sabit sunucu rolü.

Örnekler

Aşağıdaki örnek etkin ayarını değiştirir. Test Alert Kime 0.

USE msdb ;
GO

EXEC dbo.sp_update_alert
    @name = N'Test Alert',
    @enabled = 0 ;
GO