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:

  1. In Object Explorer, expand the Management node down to and including the resource pool that contains the workload group to be modified.
  2. Use the Workload Groups context menu, and select New Workload Group.
  3. In the Resource pools grid, ensure the resource pool where you want to add the workload group is selected.
  4. The Workload groups for resource pool grid has a new row with a blank name and default values in the other columns.
  5. Select the Name cell and enter a name for the workload group.
  6. Select any other cells in the row you want to change from their default settings, and enter new values.
  7. To save the changes, select OK.

Create a workload group using Transact-SQL

To create a workload group by using Transact-SQL:

  1. Execute the CREATE WORKLOAD GROUP statement specifying the values to be set.
  2. 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.