Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

Commit eb3733f

Browse files
Merge pull request #33121 from periclesrocha/patch-17
New note on MATCH_COLUMN_COUNT
2 parents 9001faa + 526bbfa commit eb3733f

1 file changed

Lines changed: 12 additions & 9 deletions

File tree

docs/t-sql/statements/copy-into-transact-sql.md

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description: Use the COPY statement in Azure Synapse Analytics and Warehouse in
55
author: WilliamDAssafMSFT
66
ms.author: wiassaf
77
ms.reviewer: procha, mikeray, fresantos
8-
ms.date: 01/15/2025
8+
ms.date: 02/11/2025
99
ms.service: sql
1010
ms.subservice: t-sql
1111
ms.topic: reference
@@ -787,15 +787,18 @@ Parser version 1.0 is available for backward compatibility only, and should be u
787787
788788
#### MATCH_COLUMN_COUNT = { 'ON' | 'OFF' }
789789

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:
791791

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*.
799802
800803
## Permissions
801804

0 commit comments

Comments
 (0)