Skip to content

Commit 132a5f3

Browse files
committed
Freshness and format
1 parent b18833f commit 132a5f3

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

articles/synapse-analytics/sql/develop-tables-data-types.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ description: Recommendations for defining table data types in Synapse SQL.
44
author: filippopovic
55
ms.author: fipopovi
66
ms.reviewer: whhender
7-
ms.date: 04/15/2020
7+
ms.date: 12/17/2024
88
ms.service: azure-synapse-analytics
99
ms.subservice: sql
10-
ms.topic: conceptual
10+
ms.topic: concept-article
1111
---
1212

1313
# Table data types in Synapse SQL
@@ -16,7 +16,7 @@ In this article, you'll find recommendations for defining table data types in Sy
1616

1717
## Data types
1818

19-
Synapse SQL Dedicated Pool supports the most commonly used data types. For a list of the supported data types, see [data types](/sql/t-sql/statements/create-table-azure-sql-data-warehouse#DataTypes&preserve-view=true) in the CREATE TABLE statement. For Synapse SQL Serverless please refer to article [Query storage files with serverless SQL pool in Azure Synapse Analytics](./query-data-storage.md) and [How to use OPENROWSET using serverless SQL pool in Azure Synapse Analytics](./develop-openrowset.md)
19+
Synapse SQL Dedicated Pool supports the most commonly used data types. For a list of the supported data types, see [data types](/sql/t-sql/statements/create-table-azure-sql-data-warehouse#DataTypes&preserve-view=true) in the CREATE TABLE statement. For Synapse SQL Serverless, refer to article [Query storage files with serverless SQL pool in Azure Synapse Analytics](./query-data-storage.md) and [How to use OPENROWSET using serverless SQL pool in Azure Synapse Analytics](./develop-openrowset.md)
2020

2121
## Minimize row length
2222

@@ -25,14 +25,14 @@ Minimizing the size of data types shortens the row length, which leads to better
2525
- Avoid defining character columns with a large default length. For example, if the longest value is 25 characters, then define your column as VARCHAR(25).
2626
- Avoid using NVARCHAR when you only need VARCHAR.
2727
- When possible, use NVARCHAR(4000) or VARCHAR(8000) instead of NVARCHAR(MAX) or VARCHAR(MAX).
28-
- Avoid using floats and decimals with 0 (zero) scale. These should be TINYINT, SMALLINT, INT or BIGINT.
28+
- Avoid using floats and decimals with 0 (zero) scale. These should be TINYINT, SMALLINT, INT, or BIGINT.
2929

3030
> [!NOTE]
3131
> If you are using PolyBase external tables to load your Synapse SQL tables, the defined length of the table row cannot exceed 1 MB. When a row with variable-length data exceeds 1 MB, you can load the row with BCP, but not with PolyBase.
3232
3333
## Identify unsupported data types
3434

35-
If you are migrating your database from another SQL database, you might encounter data types that are not supported in Synapse SQL. Use this query to discover unsupported data types in your existing SQL schema.
35+
If you're migrating your database from another SQL database, you might encounter data types that aren't supported in Synapse SQL. Use this query to discover unsupported data types in your existing SQL schema.
3636

3737
```sql
3838
SELECT t.[name], c.[name], c.[system_type_id], c.[user_type_id], y.[is_user_defined], y.[name]
@@ -45,7 +45,7 @@ WHERE y.[name] IN ('geography','geometry','hierarchyid','image','text','ntext','
4545

4646
## <a name="unsupported-data-types"></a>Workarounds for unsupported data types
4747

48-
The following list shows the data types that Synapse SQL does not support and gives alternatives that you can use instead of the unsupported data types.
48+
The following list shows the data types that Synapse SQL doesn't support and gives alternatives that you can use instead of the unsupported data types.
4949

5050
| Unsupported data type | Workaround |
5151
| --- | --- |
@@ -57,11 +57,11 @@ The following list shows the data types that Synapse SQL does not support and gi
5757
| [ntext](/sql/t-sql/data-types/ntext-text-and-image-transact-sql?view=azure-sqldw-latest&preserve-view=true) |[nvarchar](/sql/t-sql/data-types/nchar-and-nvarchar-transact-sql?view=azure-sqldw-latest&preserve-view=true) |
5858
| [sql_variant](/sql/t-sql/data-types/sql-variant-transact-sql?view=azure-sqldw-latest&preserve-view=true) |Split column into several strongly typed columns. |
5959
| [table](/sql/t-sql/data-types/table-transact-sql?view=azure-sqldw-latest&preserve-view=true) |Convert to temporary tables or consider storing data to storage using [CETAS](../sql/develop-tables-cetas.md). |
60-
| [timestamp](/sql/t-sql/data-types/date-and-time-types) |Rework code to use [datetime2](/sql/t-sql/data-types/datetime2-transact-sql?view=azure-sqldw-latest&preserve-view=true) and the [CURRENT_TIMESTAMP](/sql/t-sql/functions/current-timestamp-transact-sql?view=azure-sqldw-latest&preserve-view=true) function. Only constants are supported as defaults, therefore current_timestamp cannot be defined as a default constraint. If you need to migrate row version values from a timestamp typed column, then use [BINARY](/sql/t-sql/data-types/binary-and-varbinary-transact-sql?view=azure-sqldw-latest&preserve-view=true)(8) or [VARBINARY](/sql/t-sql/data-types/binary-and-varbinary-transact-sql?view=azure-sqldw-latest&preserve-view=true)(8) for NOT NULL or NULL row version values. |
60+
| [timestamp](/sql/t-sql/data-types/date-and-time-types) |Rework code to use [datetime2](/sql/t-sql/data-types/datetime2-transact-sql?view=azure-sqldw-latest&preserve-view=true) and the [CURRENT_TIMESTAMP](/sql/t-sql/functions/current-timestamp-transact-sql?view=azure-sqldw-latest&preserve-view=true) function. Only constants are supported as defaults, therefore current_timestamp can't be defined as a default constraint. If you need to migrate row version values from a timestamp typed column, then use [BINARY](/sql/t-sql/data-types/binary-and-varbinary-transact-sql?view=azure-sqldw-latest&preserve-view=true)(8) or [VARBINARY](/sql/t-sql/data-types/binary-and-varbinary-transact-sql?view=azure-sqldw-latest&preserve-view=true)(8) for NOT NULL or NULL row version values. |
6161
| [xml](/sql/t-sql/xml/xml-transact-sql?view=azure-sqldw-latest&preserve-view=true) |[varchar](/sql/t-sql/data-types/char-and-varchar-transact-sql?view=azure-sqldw-latest&preserve-view=true) |
6262
| [user-defined type](/sql/relational-databases/native-client/features/using-user-defined-types) |Convert back to the native data type when possible. |
6363
| default values | Default values support literals and constants only. |
6464

65-
## Next steps
65+
## Related content
6666

67-
For more information on developing tables, see [Table Overview](develop-overview.md).
67+
For more information on developing tables, see [the development overview](develop-overview.md).

0 commit comments

Comments
 (0)