core.sp_add_collector_type (Transact-SQL)

THIS TOPIC APPLIES TO:yesSQL Server (starting with 2008)noAzure SQL DatabasenoAzure SQL Data Warehouse noParallel Data Warehouse

Adds a new entry to the core.supported_collector_types view in the management data warehouse database. The procedure must be executed in the context of the management data warehouse database.

Topic link icon Transact-SQL Syntax Conventions


core.sp_add_collector_type [ @collector_type_uid = ] 'collector_type_uid'  


[ @collector_type_uid = ] 'collector_type_uid'
The GUID for the collector type. collector_type_uid is uniqueidentifier, with no default value.

Return Code Values

0 (success) or 1 (failure)


Requires membership in the mdw_admin (with EXECUTE permission) fixed database role.


The following example adds the Generic T-SQL Query collector type to the core.supported_collector_types view. By default, the Generic T-SQL Query collector type already exists. Therefore, if you run this code on a default installation, you will receive a message that the collector type already exists.

This code would run successfully if you had removed the Generic T-SQL Query collector type by using the core.sp_remove_collector_type stored procedure, and then wanted to re-add it as a registered collector type that can upload data to the management data warehouse.

USE <management_data_warehouse>;  
DECLARE @RC int;  
DECLARE @collector_type_uid uniqueidentifier;  
SELECT @collector_type_uid = (SELECT collector_type_uid FROM msdb.dbo.syscollector_collector_types WHERE name = N'Generic T-SQL Query Collector Type');  
EXECUTE @RC = core.sp_add_collector_type @collector_type_uid;  

See Also

System Stored Procedures (Transact-SQL)
Data Collector Stored Procedures (Transact-SQL)
Management Data Warehouse