| title | sp_syscollector_set_warehouse_database_name (Transact-SQL) | ||
|---|---|---|---|
| description | Specifies the database name defined in the connection string used to connect to the management data warehouse. | ||
| 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 |
|
||
| helpviewer_keywords |
|
||
| dev_langs |
|
[!INCLUDE SQL Server]
Specifies the database name defined in the connection string used to connect to the management data warehouse.
:::image type="icon" source="../../includes/media/topic-link-icon.svg" border="false"::: Transact-SQL syntax conventions
sp_syscollector_set_warehouse_database_name [ [ @database_name = ] N'database_name' ]
[ ; ]
The name of the management data warehouse. @database_name is sysname, with a default of an empty string.
0 (success) or 1 (failure).
You must disable the data collector before changing the data collector-wide configuration. This procedure fails if the data collector is enabled.
To view the current database name, query the syscollector_config_store system view.
Requires membership in the dc_admin (with EXECUTE permission) fixed database role to execute this procedure.
The following example sets the name of the management data warehouse to RemoteMDW.
USE msdb;
GO
EXECUTE sp_syscollector_set_warehouse_database_name N'RemoteMDW';
GO