Skip to content

Commit 005c98e

Browse files
authored
Merge pull request #14905 from julieMSFT/20200508_dropWLG
updates to pick a product
2 parents a263095 + a18ee24 commit 005c98e

2 files changed

Lines changed: 78 additions & 61 deletions

File tree

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
Drops an existing user-defined Resource Governor workload group.
2+
3+
![Topic link icon](../database-engine/configure-windows/media/topic-link.gif "Topic link icon") [Transact-SQL Syntax Conventions](../t-sql/language-elements/transact-sql-syntax-conventions-transact-sql.md).
4+
5+
## Syntax
6+
7+
```syntaxsql
8+
DROP WORKLOAD GROUP group_name
9+
[;]
10+
```
11+
12+
## Arguments
13+
14+
*group_name*
15+
Is the name of an existing user-defined workload group.
16+
17+
## Remarks
18+
19+
The DROP WORKLOAD GROUP statement is not allowed on the Resource Governor internal or default groups.
20+
21+
When you are executing DDL statements, we recommend that you be familiar with Resource Governor states. For more information, see [Resource Governor](../relational-databases/resource-governor/resource-governor.md).
22+
23+
If a workload group contains active sessions, dropping or moving the workload group to a different resource pool will fail when the ALTER RESOURCE GOVERNOR RECONFIGURE statement is called to apply the change. To avoid this problem, you can take one of the following actions:
24+
25+
- Wait until all the sessions from the affected group have disconnected, and then rerun the ALTER RESOURCE GOVERNOR RECONFIGURE statement.
26+
27+
- Explicitly stop sessions in the affected group by using the KILL command, and then rerun the ALTER RESOURCE GOVERNOR RECONFIGURE statement.
28+
29+
- Restart the server. After the restart process is completed, the deleted group will not be created, and a moved group will use the new resource pool assignment.
30+
31+
- In a scenario in which you have issued the DROP WORKLOAD GROUP statement but decide that you do not want to explicitly stop sessions to apply the change, you can re-create the group by using the same name that it had before you issued the DROP statement, and then move the group to the original resource pool. To apply the changes, run the ALTER RESOURCE GOVERNOR RECONFIGURE statement.
32+
33+
## Permissions
34+
35+
Requires CONTROL SERVER permission.
36+
37+
## Examples
38+
39+
The following example drops the workload group named `adhoc`.
40+
41+
```
42+
DROP WORKLOAD GROUP adhoc;
43+
GO
44+
ALTER RESOURCE GOVERNOR RECONFIGURE;
45+
GO
46+
```
47+
48+
## See Also
49+
50+
- [Resource Governor](../relational-databases/resource-governor/resource-governor.md)
51+
- [CREATE WORKLOAD GROUP (Transact-SQL)](../t-sql/statements/create-workload-group-transact-sql.md)
52+
- [ALTER WORKLOAD GROUP (Transact-SQL)](../t-sql/statements/alter-workload-group-transact-sql.md)
53+
- [CREATE RESOURCE POOL (Transact-SQL)](../t-sql/statements/create-resource-pool-transact-sql.md)
54+
- [ALTER RESOURCE POOL (Transact-SQL)](../t-sql/statements/alter-resource-pool-transact-sql.md)
55+
- [DROP RESOURCE POOL (Transact-SQL)](../t-sql/statements/drop-resource-pool-transact-sql.md)
56+
- [ALTER RESOURCE GOVERNOR (Transact-SQL)](../t-sql/statements/alter-resource-governor-transact-sql.md)

docs/t-sql/statements/drop-workload-group-transact-sql.md

Lines changed: 22 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -24,91 +24,52 @@ monikerRange: ">=sql-server-2016||=sqlallproducts-allversions||>=sql-server-linu
2424

2525
In the following row, click whichever product name you're interested in. The click displays different content here on this webpage, appropriate for whichever product you click.
2626

27-
::: moniker range=">=sql-server-2016||>=sql-server-linux-2017||=azuresqldb-mi-current||=sqlallproducts-allversions"
27+
::: moniker range=">=sql-server-2016||>=sql-server-linux-2017||=sqlallproducts-allversions"
2828

29-
> |||||
30-
> |---|---|---|---|
31-
> |**_\* SQL Server \*_** &nbsp;|[SQL Database<br />managed instance](drop-workload-group-transact-sql.md?view=azuresqldb-mi-current)|[Azure Synapse<br />Analytics](drop-workload-group-transact-sql.md?view=azure-sqldw-latest)|
29+
||||
30+
|---|---|---|
31+
|**_\* SQL Server \*_** &nbsp;|[SQL Database<br />managed instance](drop-workload-group-transact-sql.md?view=azuresqldb-mi-current)|[Azure Synapse<br />Analytics](drop-workload-group-transact-sql.md?view=azure-sqldw-latest)|
32+
||||
3233

3334
&nbsp;
3435

3536
## SQL Server and SQL Database managed instance
3637

37-
Drops an existing user-defined Resource Governor workload group.
38-
39-
![Topic link icon](../../database-engine/configure-windows/media/topic-link.gif "Topic link icon") [Transact-SQL Syntax Conventions](../../t-sql/language-elements/transact-sql-syntax-conventions-transact-sql.md).
40-
41-
## Syntax
42-
43-
```syntaxsql
44-
DROP WORKLOAD GROUP group_name
45-
[;]
46-
```
47-
48-
## Arguments
49-
50-
*group_name*
51-
Is the name of an existing user-defined workload group.
52-
53-
## Remarks
54-
55-
The DROP WORKLOAD GROUP statement is not allowed on the Resource Governor internal or default groups.
56-
57-
When you are executing DDL statements, we recommend that you be familiar with Resource Governor states. For more information, see [Resource Governor](../../relational-databases/resource-governor/resource-governor.md).
58-
59-
If a workload group contains active sessions, dropping or moving the workload group to a different resource pool will fail when the ALTER RESOURCE GOVERNOR RECONFIGURE statement is called to apply the change. To avoid this problem, you can take one of the following actions:
60-
61-
- Wait until all the sessions from the affected group have disconnected, and then rerun the ALTER RESOURCE GOVERNOR RECONFIGURE statement.
62-
63-
- Explicitly stop sessions in the affected group by using the KILL command, and then rerun the ALTER RESOURCE GOVERNOR RECONFIGURE statement.
64-
65-
- Restart the server. After the restart process is completed, the deleted group will not be created, and a moved group will use the new resource pool assignment.
66-
67-
- In a scenario in which you have issued the DROP WORKLOAD GROUP statement but decide that you do not want to explicitly stop sessions to apply the change, you can re-create the group by using the same name that it had before you issued the DROP statement, and then move the group to the original resource pool. To apply the changes, run the ALTER RESOURCE GOVERNOR RECONFIGURE statement.
68-
69-
## Permissions
70-
71-
Requires CONTROL SERVER permission.
38+
[!INCLUDE [DROP WORKLOAD GROUP](../../includes/drop-workload-group.md)]
39+
40+
::: moniker-end
41+
::: moniker range="=azuresqldb-mi-current||=sqlallproducts-allversions"
7242

73-
## Examples
43+
||||
44+
|---|---|---|
45+
|[SQL Server](drop-workload-group-transact-sql.md?view=sql-server-2017)|**_\* SQL Database<br />managed instance \*_** &nbsp;|[Azure Synapse<br />Analytics](drop-workload-group-transact-sql.md?view=azure-sqldw-latest)|
46+
||||
7447

75-
The following example drops the workload group named `adhoc`.
48+
&nbsp;
7649

77-
```
78-
DROP WORKLOAD GROUP adhoc;
79-
GO
80-
ALTER RESOURCE GOVERNOR RECONFIGURE;
81-
GO
82-
```
50+
## SQL Server and SQL Database managed instance
8351

84-
## See Also
52+
[!INCLUDE [DROP WORKLOAD GROUP](../../includes/drop-workload-group.md)]
8553

86-
- [Resource Governor](../../relational-databases/resource-governor/resource-governor.md)
87-
- [CREATE WORKLOAD GROUP &#40;Transact-SQL&#41;](../../t-sql/statements/create-workload-group-transact-sql.md)
88-
- [ALTER WORKLOAD GROUP &#40;Transact-SQL&#41;](../../t-sql/statements/alter-workload-group-transact-sql.md)
89-
- [CREATE RESOURCE POOL &#40;Transact-SQL&#41;](../../t-sql/statements/create-resource-pool-transact-sql.md)
90-
- [ALTER RESOURCE POOL &#40;Transact-SQL&#41;](../../t-sql/statements/alter-resource-pool-transact-sql.md)
91-
- [DROP RESOURCE POOL &#40;Transact-SQL&#41;](../../t-sql/statements/drop-resource-pool-transact-sql.md)
92-
- [ALTER RESOURCE GOVERNOR &#40;Transact-SQL&#41;](../../t-sql/statements/alter-resource-governor-transact-sql.md)
93-
9454
::: moniker-end
9555
::: moniker range="=azure-sqldw-latest||=sqlallproducts-allversions"
9656

97-
> ||||
98-
> |---|---|---|
99-
> |[SQL Server](drop-workload-group-transact-sql.md?view=sql-server-2017)||[SQL Database<br />managed instance](drop-workload-group-transact-sql.md?view=azuresqldb-mi-current)||**_\* Azure Synapse<br />Analytics \*_** &nbsp;||||
57+
||||
58+
|---|---|---|
59+
|[SQL Server](drop-workload-group-transact-sql.md?view=sql-server-2017)|[SQL Database<br />managed instance](drop-workload-group-transact-sql.md?view=azuresqldb-mi-current)| **_\* Azure Synapse<br />Analytics \*_** &nbsp;|
60+
||||
10061

10162
&nbsp;
10263

103-
## Azure Synapse Analytics (Preview)
64+
## Azure Synapse Analytics (preview)
10465

10566
Drops a workload group. Once the statement completes, the settings are in effect.
10667

10768
![Topic link icon](../../database-engine/configure-windows/media/topic-link.gif "Topic link icon") [Transact-SQL Syntax Conventions](../../t-sql/language-elements/transact-sql-syntax-conventions-transact-sql.md).
10869

10970
## Syntax
11071

111-
```
72+
```syntaxsql
11273
DROP WORKLOAD GROUP group_name
11374
```
11475

0 commit comments

Comments
 (0)