Skip to content

Commit 75ec13f

Browse files
committed
Edit pass
1 parent bc88a62 commit 75ec13f

10 files changed

Lines changed: 508 additions & 429 deletions

docs/connect/odbc/linux-mac/release-notes-odbc-sql-server-linux-mac.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,13 @@ title: Release Notes ODBC Driver for SQL Server on Linux and macOS
33
description: "Learn what's new and changed in released versions of the Microsoft ODBC Driver for SQL Server."
44
author: David-Engel
55
ms.author: davidengel
6-
ms.date: 12/17/2025
6+
ms.reviewer: randolphwest
7+
ms.date: 02/10/2026
78
ms.service: sql
89
ms.subservice: connectivity
9-
ms.custom: linux-related-content
1010
ms.topic: release-notes
11+
ms.custom:
12+
- linux-related-content
1113
---
1214
# Release Notes for the Microsoft ODBC Driver for SQL Server on Linux and macOS
1315

docs/connect/odbc/microsoft-odbc-driver-for-sql-server.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,21 @@ title: Microsoft ODBC Driver for SQL Server
33
description: The Microsoft ODBC Driver for SQL Server provides connectivity to SQL Server and Azure SQL Database via standard ODBC APIs.
44
author: David-Engel
55
ms.author: davidengel
6-
ms.date: 04/09/2024
6+
ms.reviewer: randolphwest
7+
ms.date: 02/10/2026
78
ms.service: sql
89
ms.subservice: connectivity
910
ms.topic: concept-article
1011
---
1112
# Microsoft ODBC Driver for SQL Server
1213

13-
[!INCLUDE[ODBC_Current_Version](../../includes/odbc-latest-release.md)]
14+
[!INCLUDE [ODBC_Current_Version](../../includes/odbc-latest-release.md)]
1415

15-
[!INCLUDE[Driver_ODBC_Download](../../includes/driver_odbc_download.md)]
16+
[!INCLUDE [Driver_ODBC_Download](../../includes/driver_odbc_download.md)]
1617

1718
ODBC is the primary native data access API for applications written in C and C++ for SQL Server. There's an ODBC driver for most data sources. Other languages that can use ODBC include COBOL, Perl, PHP, and Python. ODBC is widely used in data integration scenarios.
1819

19-
The ODBC driver comes with tools such as [**sqlcmd**](../../tools/sqlcmd/sqlcmd-utility.md) and [**bcp**](../../tools/bcp-utility.md). The **sqlcmd** utility lets you run Transact-SQL statements, system procedures, and SQL scripts. The **bcp** utility bulk copies data between an instance of Microsoft SQL Server and a data file in a format you choose. You can use **bcp** to import many new rows into SQL Server tables or to export data out of tables into data files.
20+
The ODBC driver comes with tools such as [**sqlcmd**](../../tools/sqlcmd/sqlcmd-utility.md) and [**bcp**](../../tools/bcp-utility.md). The **sqlcmd** utility lets you run Transact-SQL statements, system procedures, and SQL scripts. The **bcp** utility bulk copies data between an instance of Microsoft SQL Server and a data file in a format you choose. You can use **bcp** to import many new rows into SQL Server tables or to export data out of tables into data files.
2021

2122
## Code example in C++
2223

@@ -71,4 +72,4 @@ The following sample demonstrates how to use the ODBC APIs to connect to and acc
7172

7273
## Community
7374

74-
- [SQL Server Drivers blog](https://techcommunity.microsoft.com/t5/SQL-Server/bg-p/SQLServer/label-name/SQLServerDrivers)
75+
- [SQL Server Drivers blog](https://techcommunity.microsoft.com/t5/SQL-Server/bg-p/SQLServer/label-name/SQLServerDrivers)

docs/connect/odbc/vector-data-type.md

Lines changed: 157 additions & 113 deletions
Large diffs are not rendered by default.

docs/connect/odbc/windows/release-notes-odbc-sql-server-windows.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ title: Release Notes for ODBC Driver for SQL Server on Windows
33
description: This release notes article describes the changes in each release of the Microsoft ODBC driver for SQL Server on Windows.
44
author: David-Engel
55
ms.author: davidengel
6-
ms.date: 12/17/2025
6+
ms.reviewer: randolphwest
7+
ms.date: 02/10/2026
78
ms.service: sql
89
ms.subservice: connectivity
910
ms.topic: release-notes

docs/relational-databases/import-export/specify-field-length-by-using-bcp-sql-server.md

Lines changed: 98 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: "Specify Field Length by Using bcp (SQL Server)"
33
description: In SQL Server, if necessary, bcp prompts for field length, default field lengths, and impact of field-length on data storage in files that contain char data.
44
author: rwestMSFT
55
ms.author: randolphwest
6-
ms.date: "03/14/2017"
6+
ms.date: 02/10/2026
77
ms.service: sql
88
ms.subservice: data-movement
99
ms.topic: concept-article
@@ -13,116 +13,123 @@ helpviewer_keywords:
1313
- "field length [SQL Server]"
1414
- "data formats [SQL Server], field length"
1515
- "bcp utility [SQL Server], field length"
16-
monikerRange: ">=aps-pdw-2016||=azuresqldb-current||=azure-sqldw-latest||>=sql-server-2016||>=sql-server-linux-2017||=azuresqldb-mi-current"
16+
monikerRange: ">=aps-pdw-2016 || =azuresqldb-current || =azure-sqldw-latest || >=sql-server-2016 || >=sql-server-linux-2017 || =azuresqldb-mi-current"
1717
---
18-
# Specify Field Length by Using bcp (SQL Server)
18+
# Specify field length by using bcp (SQL Server)
1919

20-
[!INCLUDE[SQL Server Azure SQL Database Synapse Analytics PDW](../../includes/applies-to-version/sql-asdb-asdbmi-asa-pdw.md)]
21-
The field length indicates the maximum number of characters required to represent data in character format. If you store data in native format, the field length is already known. For example, the **int** data type takes 4 bytes. When you indicate 0 for the prefix length, the **bcp** command prompts you for the field length, default field lengths, and the impact of field length on data storage in data files that contain **char** data.
22-
23-
## The bcp Prompt for Field Length
20+
[!INCLUDE [SQL Server Azure SQL Database Synapse Analytics PDW](../../includes/applies-to-version/sql-asdb-asdbmi-asa-pdw.md)]
2421

25-
If an interactive **bcp** command contains the **in** or **out** option without either the format file switch (**-f**) or a data-format switch (**-n**, **-c**, **-w**, or **-N**), the command prompts for the field length of each data field, as follows:
26-
27-
`Enter length of field <field_name> [<default>]:`
28-
29-
For an example that shows this prompt in context, see [Specify Data Formats for Compatibility when Using bcp &#40;SQL Server&#41;](../../relational-databases/import-export/specify-data-formats-for-compatibility-when-using-bcp-sql-server.md).
22+
The field length indicates the maximum number of characters that are required to represent data in character format. The field length is already known if the data is stored in the native format; for example, the **int** data type takes 4 bytes. If you have indicated 0 for the prefix length, the **bcp** command prompts you for field length, the default field lengths, and the impact of field-length on data storage in data files that contain **char** data.
3023

31-
> [!NOTE]
32-
> After you interactively specify all of the fields in a **bcp** command, the command prompts you save your responses for each field in a non-XML format file. For more information on non-XML format files, see [Non-XML Format Files &#40;SQL Server&#41;](../../relational-databases/import-export/non-xml-format-files-sql-server.md).
24+
## The bcp prompt for field length
25+
26+
If an interactive **bcp** command contains the `in` or `out` option without either the format file switch (`-f`) or a data-format switch (`-n`, `-c`, `-w`, or `-N`), the command prompts for the field length of each data field, as follows:
27+
28+
`Enter length of field <field_name> [<default>]:`
29+
30+
For an example that shows this prompt in context, see [Specify Data Formats for Compatibility when Using bcp (SQL Server)](../../relational-databases/import-export/specify-data-formats-for-compatibility-when-using-bcp-sql-server.md).
31+
32+
> [!NOTE]
33+
> After you interactively specify all of the fields in a **bcp** command, the command prompts you save your responses for each field in a non-XML format file. For more information on non-XML format files, see [Non-XML Format Files (SQL Server)](../../relational-databases/import-export/non-xml-format-files-sql-server.md).
3334
3435
Whether a **bcp** command prompts for field length depends on several factors, as follows:
3536

36-
- When you copy data types that are not of fixed length and you specify a prefix length of 0, **bcp** prompts for a field length.
37+
- When you copy data types that aren't of fixed length and you specify a prefix length of 0, **bcp** prompts for a field length.
3738

3839
- When converting noncharacter data to character data, **bcp** suggests a default field length large enough to store the data.
3940

40-
- If the file storage type is noncharacter, the **bcp** command does not prompt for a field length. The data is stored in the [!INCLUDE[msCoName](../../includes/msconame-md.md)] [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] native data representation (native format).
41+
- If the file storage type is noncharacter, the **bcp** command doesn't prompt for a field length. The data is stored in the [!INCLUDE [msCoName](../../includes/msconame-md.md)] [!INCLUDE [ssNoVersion](../../includes/ssnoversion-md.md)] native data representation (native format).
42+
43+
<a id="using-default-field-lengths"></a>
4144

42-
## Using Default Field Lengths
45+
## Use default field lengths
4346

44-
Generally, [!INCLUDE[msCoName](../../includes/msconame-md.md)] recommends that you accept the **bcp**-suggested default values for the field length. When you create a character mode data file, using the default field length ensures that data is not truncated and that numeric overflow errors do not occur.
47+
Generally, [!INCLUDE [msCoName](../../includes/msconame-md.md)] recommends that you accept the **bcp**-suggested default values for the field length. When a character mode data file is created, using the default field length ensures that data isn't truncated and that numeric overflow errors don't occur.
4548

46-
When you specify an incorrect field length, problems can occur. For instance, if you copy numeric data and specify a field length that is too short, the **bcp** utility prints an overflow message and does not copy the data. Also, if you export **datetime** data and specify a field length of less than 26 bytes for the character string, the **bcp** utility truncates the data without an error message.
49+
If you specify a field length that is incorrect, problems can occur. For instance, if you copy numeric data and you specify a field length that is too short for the data, the **bcp** utility prints an overflow message and doesn't copy the data. Also, if you export **datetime** data and specify a field length of less than 26 bytes for the character string, the **bcp** utility truncates the data without an error message.
4750

48-
> [!IMPORTANT]
49-
> When the default size option is used, [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] expects to read an entire string. In some situations, use of a default field length can lead to an "unexpected end of file" error. Typically, this error occurs with the **money** and **datetime** data types when only part of the expected field occurs in the data file; for example, when a **datetime** value of *mm*/*dd*/*yy* is specified without the time component and is, therefore, shorter than the expected 24 character length of a **datetime** value in **char** format. To avoid this type of error, use field terminators or fixed-length data fields, or change the default field length by specifying another value.
51+
> [!IMPORTANT]
52+
> When the default size option is used, [!INCLUDE [ssNoVersion](../../includes/ssnoversion-md.md)] expects to read an entire string. In some situations, use of a default field length can lead to an "unexpected end of file" error. Typically, this error occurs with the **money** and **datetime** data types when only part of the expected field occurs in the data file; for example, when a **datetime** value of *mm*/*dd*/*yy* is specified without the time component and is, therefore, shorter than the expected 24 character length of a **datetime** value in **char** format. To avoid this type of error, use field terminators or fixed-length data fields, or change the default field length by specifying another value.
5053
51-
### Default Field Lengths for Character File Storage
54+
### Default field lengths for character file storage
5255

5356
The following table lists the default field lengths for data to be stored as a character-file storage type. Nullable data is the same length as nonnull data.
5457

55-
|Data type|Default length (characters)|
56-
|---------------|-----------------------------------|
57-
|**char**|Length defined for the column|
58-
|**varchar**|Length defined for the column|
59-
|**nchar**|Twice the length defined for the column|
60-
|**nvarchar**|Twice the length defined for the column|
61-
|**Text**|0|
62-
|**ntext**|0|
63-
|**bit**|1|
64-
|**binary**|Twice the length defined for the column + 1|
65-
|**varbinary**|Twice the length defined for the column + 1|
66-
|**image**|0|
67-
|**datetime**|24|
68-
|**smalldatetime**|24|
69-
|**float**|30|
70-
|**real**|30|
71-
|**int**|12|
72-
|**bigint**|19|
73-
|**smallint**|7|
74-
|**tinyint**|5|
75-
|**money**|30|
76-
|**smallmoney**|30|
77-
|**decimal**|41*|
78-
|**numeric**|41*|
79-
|**uniqueidentifier**|37|
80-
|**timestamp**|17|
81-
|**varchar(max)**|0|
82-
|**varbinary(max)**|0|
83-
|**nvarchar(max)**|0|
84-
|UDT|Length of the user-defined term (UDT) column|
85-
|XML|0|
86-
87-
\*For more information about the **decimal** and **numeric** data types, see [decimal and numeric &#40;Transact-SQL&#41;](../../t-sql/data-types/decimal-and-numeric-transact-sql.md).
88-
89-
> [!NOTE]
58+
| Data type | Default length (characters) |
59+
| --- | --- |
60+
| **char** | Length defined for the column |
61+
| **varchar** | Length defined for the column |
62+
| **nchar** | Twice the length defined for the column |
63+
| **nvarchar** | Twice the length defined for the column |
64+
| **Text** | 0 |
65+
| **ntext** | 0 |
66+
| **bit** | 1 |
67+
| **binary** | Twice the length defined for the column + 1 |
68+
| **varbinary** | Twice the length defined for the column + 1 |
69+
| **image** | 0 |
70+
| **datetime** | 24 |
71+
| **smalldatetime** | 24 |
72+
| **float** | 30 |
73+
| **real** | 30 |
74+
| **int** | 12 |
75+
| **bigint** | 19 |
76+
| **smallint** | 7 |
77+
| **tinyint** | 5 |
78+
| **money** | 30 |
79+
| **smallmoney** | 30 |
80+
| **decimal** | 41 <sup>1</sup> |
81+
| **numeric** | 41 <sup>1</sup> |
82+
| **uniqueidentifier** | 37 |
83+
| **timestamp** | 17 |
84+
| **varchar(max)** | 0 |
85+
| **varbinary(max)** | 0 |
86+
| **nvarchar(max)** | 0 |
87+
| **UDT** | Length of the user-defined term (UDT) column |
88+
| **XML** | 0 |
89+
| **vector** | N/A <sup>2</sup> |
90+
91+
<sup>1</sup> For more information about the **decimal** and **numeric** data types, see [Decimal and numeric (Transact-SQL)](../../t-sql/data-types/decimal-and-numeric-transact-sql.md).
92+
93+
<sup>2</sup> Conversion of **vector** data type to and from character isn't allowed.
94+
95+
> [!NOTE]
9096
> A column of type **tinyint** can have values from 0 through 255; the maximum number of characters that are needed to represent any number in that range is three (representing values 100 through 255).
9197
92-
### Default Field Lengths for Native File Storage
98+
### Default field lengths for native file storage
9399

94100
The following table lists the default field lengths for data to be stored as native file storage type. Nullable data is the same length as nonnull data, and character data is always stored in character format.
95101

96-
|Data type|Default length (characters)|
97-
|---------------|-----------------------------------|
98-
|**bit**|1|
99-
|**binary**|Length defined for the column|
100-
|**varbinary**|Length defined for the column|
101-
|**image**|0|
102-
|**datetime**|8|
103-
|**smalldatetime**|4|
104-
|**float**|8|
105-
|**real**|4|
106-
|**int**|4|
107-
|**bigint**|8|
108-
|**smallint**|2|
109-
|**tinyint**|1|
110-
|**money**|8|
111-
|**smallmoney**|4|
112-
|**decimal**|*|
113-
|**numeric**|*|
114-
|**uniqueidentifier**|16|
115-
|**timestamp**|8|
116-
117-
\*For more information about the **decimal** and **numeric** data types, see [decimal and numeric &#40;Transact-SQL&#41;](../../t-sql/data-types/decimal-and-numeric-transact-sql.md).
118-
119-
In all of the preceding cases, to create a data file for later reloading into [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] that keeps the storage space to a minimum, use a length prefix with the default file storage type and the default field length.
120-
121-
## See Also
122-
123-
[bcp Utility](../../tools/bcp-utility.md)
124-
[Data Types &#40;Transact-SQL&#41;](../../t-sql/data-types/data-types-transact-sql.md)
125-
[Specify Field and Row Terminators &#40;SQL Server&#41;](../../relational-databases/import-export/specify-field-and-row-terminators-sql-server.md)
126-
[Specify Prefix Length in Data Files by Using bcp &#40;SQL Server&#41;](../../relational-databases/import-export/specify-prefix-length-in-data-files-by-using-bcp-sql-server.md)
127-
[Specify File Storage Type by Using bcp &#40;SQL Server&#41;](../../relational-databases/import-export/specify-file-storage-type-by-using-bcp-sql-server.md)
128-
[Keep Nulls or Use Default Values During Bulk Import &#40;SQL Server&#41;](../../relational-databases/import-export/keep-nulls-or-use-default-values-during-bulk-import-sql-server.md)
102+
| Data type | Default length (characters) |
103+
| --- | --- |
104+
| **bit** | 1 |
105+
| **binary** | Length defined for the column |
106+
| **varbinary** | Length defined for the column |
107+
| **image** | 0 |
108+
| **datetime** | 8 |
109+
| **smalldatetime** | 4 |
110+
| **float** | 8 |
111+
| **real** | 4 |
112+
| **int** | 4 |
113+
| **bigint** | 8 |
114+
| **smallint** | 2 |
115+
| **tinyint** | 1 |
116+
| **money** | 8 |
117+
| **smallmoney** | 4 |
118+
| **decimal** | <sup>1</sup> |
119+
| **numeric** | <sup>1</sup> |
120+
| **uniqueidentifier** | 16 |
121+
| **timestamp** | 8 |
122+
| **vector** | 8-byte vector header + float array size |
123+
124+
<sup>1</sup> For more information about the **decimal** and **numeric** data types, see [decimal and numeric (Transact-SQL)](../../t-sql/data-types/decimal-and-numeric-transact-sql.md).
125+
126+
In all of the preceding cases, to create a data file for later reloading into [!INCLUDE [ssNoVersion](../../includes/ssnoversion-md.md)] that keeps the storage space to a minimum, use a length prefix with the default file storage type and the default field length.
127+
128+
## Related content
129+
130+
- [bcp utility](../../tools/bcp-utility.md)
131+
- [Data types (Transact-SQL)](../../t-sql/data-types/data-types-transact-sql.md)
132+
- [Specify field and row terminators (SQL Server)](specify-field-and-row-terminators-sql-server.md)
133+
- [Specify prefix length in data files using bcp (SQL Server)](specify-prefix-length-in-data-files-by-using-bcp-sql-server.md)
134+
- [Specify file storage type using bcp (SQL Server)](specify-file-storage-type-by-using-bcp-sql-server.md)
135+
- [Keep nulls or default values during bulk import (SQL Server)](keep-nulls-or-use-default-values-during-bulk-import-sql-server.md)

0 commit comments

Comments
 (0)