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: docs/t-sql/statements/copy-into-transact-sql.md
+12-9Lines changed: 12 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ description: Use the COPY statement in Azure Synapse Analytics and Warehouse in
5
5
author: WilliamDAssafMSFT
6
6
ms.author: wiassaf
7
7
ms.reviewer: procha, mikeray, fresantos
8
-
ms.date: 01/15/2025
8
+
ms.date: 02/11/2025
9
9
ms.service: sql
10
10
ms.subservice: t-sql
11
11
ms.topic: reference
@@ -787,15 +787,18 @@ Parser version 1.0 is available for backward compatibility only, and should be u
787
787
788
788
#### MATCH_COLUMN_COUNT = { 'ON' | 'OFF' }
789
789
790
-
*MATCH_COLUMN_COUNT* only applies to CSV. Default is OFF. Specifies if the COPY command should check if the column count rows in source files match the column count of the destination table. The following behavior applies:
790
+
*MATCH_COLUMN_COUNT* only applies to CSV. Default is `OFF`. Specifies if the `COPY` command should check if the column count rows in source files match the column count of the destination table. The following behavior applies:
791
791
792
-
- If MATCH_COLUMN_COUNT is OFF
793
-
- Exceeding columns from source rows are ignored
794
-
- Rows with fewer columns are inserted as null in nullable columns
795
-
- If a value is not provided to a non-nullable column, the COPY command fails
796
-
- If MATCH_COLUMN_COUNT is ON
797
-
- The COPY command checks if the column count on each row in each file from the source matches the column count of the destination table
798
-
- If there is a column count mismatch, the COPY command fails
792
+
- If *MATCH_COLUMN_COUNT* is `OFF`:
793
+
- Exceeding columns from source rows are ignored.
794
+
- Rows with fewer columns are inserted as null in nullable columns.
795
+
- If a value is not provided to a non-nullable column, the COPY command fails.
796
+
- If *MATCH_COLUMN_COUNT* is `ON`:
797
+
- The COPY command checks if the column count on each row in each file from the source matches the column count of the destination table.
798
+
- If there is a column count mismatch, the COPY command fails.
799
+
800
+
> [!NOTE]
801
+
> *MATCH_COLUMN_COUNT* works independently from *MAXERRORS*. A column count mismatch causes `COPY INTO` to fail regardless of *MAXERRORS*.
0 commit comments