Create a workload group
Applies to: SQL Server Azure SQL Managed Instance
You can create a workload group by using SQL Server Management Studio or Transact-SQL.
Permissions
Creating a workload group requires the CONTROL SERVER
permission.
Create a workload group using SQL Server Management Studio
To create a workload group using SQL Server Management Studio:
- In Object Explorer, expand the Management node down to and including the resource pool that contains the workload group to be modified.
- Use the Workload Groups context menu, and select New Workload Group.
- In the Resource pools grid, ensure the resource pool where you want to add the workload group is selected.
- The Workload groups for resource pool grid has a new row with a blank name and default values in the other columns.
- Select the Name cell and enter a name for the workload group.
- Select any other cells in the row you want to change from their default settings, and enter new values.
- To save the changes, select OK.
Create a workload group using Transact-SQL
To create a workload group by using Transact-SQL:
- Execute the CREATE WORKLOAD GROUP statement specifying the values to be set.
- Execute the
ALTER RESOURCE GOVERNOR RECONFIGURE
statement for the changes to take effect.
Example
The following example creates a workload group named groupAdhoc
in the resource pool named poolAdhoc
, and configures the maximum memory grant per request.
CREATE WORKLOAD GROUP groupAdhoc WITH (REQUEST_MAX_MEMORY_GRANT_PERCENT = 30)
USING poolAdhoc;
ALTER RESOURCE GOVERNOR RECONFIGURE;
Resource pools can govern a variety of system resources. For more information, see CREATE WORKLOAD GROUP.
For more samples and a complete walkthrough, see Tutorial: Resource governor configuration examples and best practices.