You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/synapse-analytics/sql/develop-tables-data-types.md
+9-9Lines changed: 9 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,10 +4,10 @@ description: Recommendations for defining table data types in Synapse SQL.
4
4
author: filippopovic
5
5
ms.author: fipopovi
6
6
ms.reviewer: whhender
7
-
ms.date: 04/15/2020
7
+
ms.date: 12/17/2024
8
8
ms.service: azure-synapse-analytics
9
9
ms.subservice: sql
10
-
ms.topic: conceptual
10
+
ms.topic: concept-article
11
11
---
12
12
13
13
# Table data types in Synapse SQL
@@ -16,7 +16,7 @@ In this article, you'll find recommendations for defining table data types in Sy
16
16
17
17
## Data types
18
18
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)
20
20
21
21
## Minimize row length
22
22
@@ -25,14 +25,14 @@ Minimizing the size of data types shortens the row length, which leads to better
25
25
- 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).
26
26
- Avoid using NVARCHAR when you only need VARCHAR.
27
27
- 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.
29
29
30
30
> [!NOTE]
31
31
> 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.
32
32
33
33
## Identify unsupported data types
34
34
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.
@@ -45,7 +45,7 @@ WHERE y.[name] IN ('geography','geometry','hierarchyid','image','text','ntext','
45
45
46
46
## <aname="unsupported-data-types"></a>Workarounds for unsupported data types
47
47
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.
49
49
50
50
| Unsupported data type | Workaround |
51
51
| --- | --- |
@@ -57,11 +57,11 @@ The following list shows the data types that Synapse SQL does not support and gi
|[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. |
59
59
|[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. |
0 commit comments