AlertCategories Collection (SQL-DMO)

The AlertCategories collection contains Category objects referencing SQL Server Agent alert categories.

Remarks

With the AlertCategories collection, you can create and maintain names grouping Microsoft® SQL Server™ alerts.

The AlertCategories collection contains, at a minimum, a Category object named [Uncategorized] and one named Replication.

To create an alert category

  1. Create a Category object.
  2. Set the Name property of the Category object. Alert category names are unique on a server running SQL Server.
  3. Add the Category object to the AlertCategories collection of a connected JobServer object.

To remove an alert category

  1. Use the Remove method of the AlertCategories collection of a connected JobServer object. Indicate the targeted alert category using the category name or the ordinal location in the collection, as in:

    oJobServer.AlertCategories.Remove("Northwind")

      


Note Alerts are recategorized as necessary when an alert category is removed. Any alerts previously exhibiting the removed category exhibit the category [Uncategorized] after the Remove method completes.


Methods
Add Method Refresh Method
ItemByID Method Remove Method (Collections)

  


(c) 1988-98 Microsoft Corporation. All Rights Reserved.