Skip to content

Commit 42d62a1

Browse files
committed
Format and acrolinx update
1 parent 8596a6a commit 42d62a1

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

articles/synapse-analytics/sql-data-warehouse/sql-data-warehouse-table-constraints.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ description: Table constraints support using dedicated SQL pool in Azure Synapse
44
author: mstehrani
55
ms.author: emtehran
66
ms.reviewer: nibruno; wiassaf
7-
ms.date: 09/05/2019
7+
ms.date: 02/21/2025
88
ms.service: azure-synapse-analytics
99
ms.subservice: sql-dw
10-
ms.topic: conceptual
10+
ms.topic: concept-article
1111
ms.custom:
1212
- azure-synapse
1313
---
@@ -19,23 +19,23 @@ Learn about table constraints in dedicated SQL pool, including primary key, fore
1919
## Table constraints
2020

2121
Dedicated SQL pool supports these table constraints:
22-
- PRIMARY KEY is only supported when NONCLUSTERED and NOT ENFORCED are both used.
22+
- PRIMARY KEY is only supported when NONCLUSTERED and NOT ENFORCED are both used.
2323
- UNIQUE constraint is only supported when NOT ENFORCED is used.
2424

2525
For syntax, check [ALTER TABLE](/sql/t-sql/statements/alter-table-transact-sql) and [CREATE TABLE](/sql/t-sql/statements/create-table-azure-sql-data-warehouse).
2626

27-
FOREIGN KEY constraint is not supported in dedicated SQL pool.
27+
FOREIGN KEY constraint isn't supported in dedicated SQL pool.
2828

2929

3030
## Remarks
3131

32-
Having primary key and/or unique key allows dedicated SQL pool engine to generate an optimal execution plan for a query. All values in a primary key column or a unique constraint column should be unique.
32+
Having primary key and/or unique key allows dedicated SQL pool engine to generate an optimal execution plan for a query. All values in a primary key column or a unique constraint column should be unique.
3333

3434
> [!IMPORTANT]
3535
> After creating a table with primary key or unique constraint in dedicated SQL pool, users need to make sure all values in those columns are unique.
3636
> A violation of that may cause the query to return inaccurate result.
3737
38-
This example shows how a query may return inaccurate result if the primary key or unique constraint column includes duplicate values.
38+
This example shows how a query may return inaccurate result if the primary key or unique constraint column includes duplicate values.
3939

4040
```sql
4141
-- Create table t1
@@ -48,7 +48,7 @@ INSERT INTO t1 VALUES (2, 200)
4848
INSERT INTO t1 VALUES (3, 300)
4949
INSERT INTO t1 VALUES (4, 400)
5050

51-
-- Run this query. No primary key or unique constraint. 4 rows returned. Correct result.
51+
-- Run this query. No primary key or unique constraint. 4 rows returned. Correct result.
5252
SELECT a1, COUNT(*) AS total FROM t1 GROUP BY a1
5353

5454
/*
@@ -65,7 +65,7 @@ a1 total
6565
-- Add unique constraint
6666
ALTER TABLE t1 ADD CONSTRAINT unique_t1_a1 unique (a1) NOT ENFORCED
6767

68-
-- Re-run this query. 5 rows returned. Incorrect result.
68+
-- Re-run this query. 5 rows returned. Incorrect result.
6969
SELECT a1, count(*) AS total FROM t1 GROUP BY a1
7070

7171
/*
@@ -86,7 +86,7 @@ ALTER TABLE t1 DROP CONSTRAINT unique_t1_a1
8686
-- Add primary key constraint
8787
ALTER TABLE t1 add CONSTRAINT PK_t1_a1 PRIMARY KEY NONCLUSTERED (a1) NOT ENFORCED
8888

89-
-- Re-run this query. 5 rows returned. Incorrect result.
89+
-- Re-run this query. 5 rows returned. Incorrect result.
9090
SELECT a1, COUNT(*) AS total FROM t1 GROUP BY a1
9191

9292
/*
@@ -122,7 +122,7 @@ a1 b1
122122
-- Add unique constraint
123123
ALTER TABLE t1 add CONSTRAINT unique_t1_a1 UNIQUE (a1) NOT ENFORCED
124124

125-
-- Re-run this query. 5 rows returned. Correct result.
125+
-- Re-run this query. 5 rows returned. Correct result.
126126
SELECT a1, COUNT(*) as total FROM t1 GROUP BY a1
127127

128128
/*
@@ -143,7 +143,7 @@ ALTER TABLE t1 DROP CONSTRAINT unique_t1_a1
143143
-- Add primary key constraint
144144
ALTER TABLE t1 ADD CONSTRAINT PK_t1_a1 PRIMARY KEY NONCLUSTERED (a1) NOT ENFORCED
145145

146-
-- Re-run this query. 5 rows returned. Correct result.
146+
-- Re-run this query. 5 rows returned. Correct result.
147147
SELECT a1, COUNT(*) AS total FROM t1 GROUP BY a1
148148

149149
/*
@@ -174,6 +174,6 @@ Create a dedicated SQL pool table with a unique constraint:
174174
CREATE TABLE t6 (c1 INT UNIQUE NOT ENFORCED, c2 INT);
175175
```
176176

177-
## Next steps
177+
## Related content
178178

179179
After creating the tables for your dedicated SQL pool, the next step is to load data into the table. For a loading tutorial, see [Loading data to dedicated SQL pool](load-data-wideworldimportersdw.md).

0 commit comments

Comments
 (0)