View Information About an AlertView Information About an Alert

适用于:Applies to: 是SQL ServerSQL Server(所有支持的版本)yesSQL ServerSQL Server (all supported versions) 是Azure SQL 托管实例Azure SQL Managed InstanceYesAzure SQL 托管实例Azure SQL Managed Instance适用于:Applies to: 是SQL ServerSQL Server(所有支持的版本)yesSQL ServerSQL Server (all supported versions) 是Azure SQL 托管实例Azure SQL Managed InstanceYesAzure SQL 托管实例Azure SQL Managed Instance

重要

Azure SQL 托管实例目前支持大多数(但不是所有)SQL Server 代理功能。On Azure SQL Managed Instance, most, but not all SQL Server Agent features are currently supported. 有关详细信息,请参阅 Azure SQL 托管实例与 SQL Server 的 T-SQL 区别See Azure SQL Managed Instance T-SQL differences from SQL Server for details.

本主题说明如何使用 SQL Server Management StudioSQL Server Management StudioTransact-SQLTransact-SQLSQL ServerSQL Server 中查看有关 MicrosoftMicrosoft SQL ServerSQL Server 代理警报的信息。This topic describes how to view information about MicrosoftMicrosoft SQL ServerSQL Server Agent alerts in SQL ServerSQL Server by using SQL Server Management StudioSQL Server Management Studio or Transact-SQLTransact-SQL.

开始之前Before You Begin

安全性Security

权限Permissions

默认情况下,只有 sysadmin 固定服务器角色的成员才能查看有关警报的信息。By default, members of the sysadmin fixed server role can view information about an alert. 其他用户必须被授予 msdb 数据库中的 SQLAgentOperatorRole 固定数据库角色的权限。Other users must be granted the SQLAgentOperatorRole fixed database role in the msdb database.

使用 SQL Server Management StudioUsing SQL Server Management Studio

查看有关警报的信息To view information about an alert

  1. “对象资源管理器” 中,单击加号以展开要在其中查看有关警报的信息的服务器。In Object Explorer, click the plus sign to expand the server where you want to view information about an alert.

  2. 单击加号以展开 “SQL Server 代理”Click the plus sign to expand SQL Server Agent.

  3. 单击加号以展开 “警报” 文件夹。Click the plus sign to expand the Alerts folder.

  4. 右键单击包含要查看的信息的警报,然后选择“属性”。Right-click the alert that has the information you want to view and select Properties.

    有关 alert_name“警报属性”对话框中包含的可用选项的详细信息,请参阅:For more information on the available options contained in the alert_namealert properties dialog box, see:

  5. 完成后,单击 “确定”When finished, click OK.

使用 Transact-SQLUsing Transact-SQL

查看有关警报的信息To view information about an alert

  1. “对象资源管理器” 中,连接到 数据库引擎Database Engine的实例。In Object Explorer, connect to an instance of 数据库引擎Database Engine.

  2. 在标准菜单栏上,单击 “新建查询”On the Standard bar, click New Query.

  3. 将以下示例复制并粘贴到查询窗口中,然后单击“执行” 。Copy and paste the following example into the query window and click Execute.

    -- reports information about the Demo: Sev. 25 Errors alert  
    -- This example assumes that the 'Demo: Sev. 25 Errors' alert exists.  
    USE msdb ;  
    GO  
    
    EXEC sp_help_alert @alert_name = 'Demo: Sev. 25 Errors'  
    GO  
    

有关详细信息,请参阅 sp_help_alert (Transact-SQL)For more information, see sp_help_alert (Transact-SQL).