Skip to content

Latest commit

 

History

History
80 lines (55 loc) · 2.49 KB

File metadata and controls

80 lines (55 loc) · 2.49 KB
title sp_syscollector_stop_collection_set (Transact-SQL)
description Stops a collection set.
author markingmyname
ms.author maghan
ms.reviewer randolphwest
ms.date 06/23/2025
ms.service sql
ms.subservice system-objects
ms.topic reference
f1_keywords
sp_syscollector_stop_collection_set_TSQL
sp_syscollector_stop_collection_set
helpviewer_keywords
sp_syscollector_stop_collection_set
data collector [SQL Server], stored procedures
dev_langs
TSQL

sp_syscollector_stop_collection_set (Transact-SQL)

[!INCLUDE SQL Server]

Stops a collection set.

:::image type="icon" source="../../includes/media/topic-link-icon.svg" border="false"::: Transact-SQL syntax conventions

Syntax

sp_syscollector_stop_collection_set
    [ [ @collection_set_id = ] collection_set_id ]
    [ , [ @name = ] N'name' ]
    [ , [ @stop_collection_job = ] stop_collection_job ]
[ ; ]

Arguments

[ @collection_set_id = ] collection_set_id

The unique local identifier for the collection set. @collection_set_id is int, with a default of NULL. @collection_set_id must have a value if @name is NULL.

[ @name = ] N'name'

The name of the collection set. @name is sysname, with a default of NULL. @name must have a value if @collection_set_id is NULL.

[ @stop_collection_job = ] stop_collection_job

Specifies that the collection job for the collection set should be stopped if it's running. @stop_collection_job is bit, with a default 1.

@stop_collection_job applies only to collection sets with collection mode set to cached. For more information, see sp_syscollector_create_collection_set.

Return code values

0 (success) or 1 (failure).

Remarks

sp_syscollector_create_collection_set must be run in the context of the msdb system database.

Permissions

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

Examples

The following example stops a collection set using its identifier.

USE msdb;
GO

EXECUTE sp_syscollector_stop_collection_set @collection_set_id = 1;

Related content