Skip to content

Latest commit

 

History

History
70 lines (54 loc) · 2.88 KB

File metadata and controls

70 lines (54 loc) · 2.88 KB
title sp_syscollector_delete_collection_item (Transact-SQL) | Microsoft Docs
ms.custom
ms.date 03/06/2017
ms.prod sql
ms.prod_service database-engine
ms.reviewer
ms.technology system-objects
ms.topic language-reference
f1_keywords
sp_syscollector_delete_collection_item
sp_syscollector_delete_collection_item_TSQL
dev_langs
TSQL
helpviewer_keywords
sp_syscollector_delete_collecton_item
data collector [SQL Server], stored procedures
ms.assetid 9c2b0990-1d3d-4a59-94a0-3cca6fef4681
author stevestein
ms.author sstein

sp_syscollector_delete_collection_item (Transact-SQL)

[!INCLUDEtsql-appliesto-ss2008-xxxx-xxxx-xxx-md]

Deletes a collection item from a collection set.

Topic link icon Transact-SQL Syntax Conventions

Syntax

  
sp_syscollector_delete_collection_item [[ @collection_item_id = ] collection_item_id ]  
    , [[ @name = ] 'name' ]   

Arguments

[ @collection_item_id = ] collection_item_id
Is the unique identifier for the collection item. collection_item_id is int with a default of NULL. collection_item_id must have a value if name is NULL.

[ @name = ] 'name'
Is the name of the collection item. name is sysname with a default value of NULL. name must have a value if collection_item_id is NULL.

Return Code Values

0 (success) or 1 (failure)

Remarks

sp_syscollector_delete_collection_item must be run in the context of the msdb system database. Collection items cannot be deleted from system collection sets.

The collection set that contains the collection item is stopped and restarted during this operation.

Permissions

Requires membership in the dc_admin (with EXECUTE permission) fixed database role to execute this procedure.

Examples

The following example deletes a collection item named MyCollectionItem1.

USE msdb;  
GO  
EXEC sp_syscollector_delete_collection_item @name = 'MyCollectionItem1';  

See Also

Data Collection
sp_syscollector_create_collection_item (Transact-SQL)
Data Collector Stored Procedures (Transact-SQL)
syscollector_collection_items (Transact-SQL)