Share via


OperatorCategories Collection

Cette fonctionnalité sera supprimée dans une prochaine version de Microsoft SQL Server. Évitez d'utiliser cette fonctionnalité dans de nouveaux travaux de développement et prévoyez de modifier les applications qui utilisent actuellement cette fonctionnalité.

The OperatorCategories collection contains Category objects that reference a classification method for SQL Server Agent operators.

Modèle objet SQL-DMO qui affiche l'objet en cours

Properties

Notes

For SQL Server Agent, categories offer a mixed system and user-defined method for grouping alerts, operators, and jobs.

With the OperatorCategories collection, you can:

  • Create a new classification for SQL Server Agent operators.

  • Remove a SQL Server Agent operator classification.

For more information about creating a SQL Server Agent operator category, see Category Object.

To remove an operator category

  • Use the Remove method of the OperatorCategories collection, as in:

    oJobServer.OperatorCategories.Remove("Page")
    

    [!REMARQUE]

    When using the Remove method of the OperatorCategories collection, existing SQL Server Agent jobs are reclassified as necessary. Any operators previously exhibiting the removed category exhibit the category [Uncategorized] after the Remove method completes.

When using the Item or Remove method, the OperatorCategories collection supports member identification using either name or ordinal reference syntax. For example:

Set oCategory = oJobServer.OperatorCategories("Page")

Or:

Set oCategory = oJobServer.OperatorCategories(1)