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
Sets a **boolean** value that indicates if sending string parameters to the server in UNICODE format is enabled.
17
+
Sets a **boolean** value that indicates whether the driver sends string parameters to the server in Unicode format.
18
18
19
19
## Syntax
20
20
@@ -26,17 +26,21 @@ public void setSendStringParametersAsUnicode(boolean sendStringParametersAsUnico
26
26
#### Parameters
27
27
*sendStringParametersAsUnicode*
28
28
29
-
**true** if string parameters are sent to the server in UNICODE format. Otherwise, **false**.
29
+
**true** if the driver sends string parameters to the server in Unicode format. Otherwise, **false**.
30
30
31
31
## Remarks
32
-
If the sendStringParametersAsUnicode property is set to **true**, which is the default value, string parameters are sent to the server in UNICODE format. If sendStringParametersAsUnicode is set to **false** string parameters are sent to the server in an ASCII/MBCS format, not in UNICODE. If sendStringParametersAsUnicode is not set, [getSendStringParametersAsUnicode](../../../connect/jdbc/reference/getsendstringparametersasunicode-method-sqlserverdatasource.md) returns the default value of **true**.
32
+
When the sendStringParametersAsUnicode property is set to **true**, which is the default value, the driver sends string parameters to the server in **UTF-16LE (UTF-16 Little Endian) encoding**, matching SQL Server's internal NCHAR/NVARCHAR storage format. The driver converts CHAR, VARCHAR, and LONGVARCHAR types to NCHAR, NVARCHAR, and LONGNVARCHAR respectively before sending them to the server.
33
33
34
-
Note: Changing this value can affect sorting of results from the database. The sorting differences are due to different sorting rules for Unicode versus non-Unicode characters.
34
+
When sendStringParametersAsUnicode is set to **false**, the driver sends string parameters in the database's collation-specific **MBCS (Multi-Byte Character Set) encoding**. The specific code page used depends on the target database or column collation. This isn't ASCII (which is 7-bit only), but rather the full character encoding defined by the collation.
35
35
36
-
For more information about the sendStringParametersAsUnicode connection property, see [Setting the Connection Properties](../../../connect/jdbc/setting-the-connection-properties.md).
If you don't set sendStringParametersAsUnicode, getSendStringParametersAsUnicode returns the default value of **true**.
37
+
38
+
> [!NOTE]
39
+
> Changing this value can affect the sorting of results from the database. The sorting differences are due to different sorting rules for Unicode versus non-Unicode characters. For VARCHAR/CHAR columns, setting this to **false** avoids implicit conversion overhead on the server.
40
+
41
+
For more information about the sendStringParametersAsUnicode connection property, see [Setting the Connection Properties](../../../connect/jdbc/setting-the-connection-properties.md). For details about SQL Server's Unicode support, see [Collation and Unicode Support](/sql/relational-databases/collations/collation-and-unicode-support).
Copy file name to clipboardExpand all lines: docs/connect/oledb/when-to-use-oledb-driver-for-sql-server.md
+13-12Lines changed: 13 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@ title: "When to Use OLE DB Driver"
3
3
description: "Learn when to use OLE DB Driver for SQL Server and the high level data access concepts that differentiate the different it from other drivers."
OLE DB Driver for SQL Server is one technology that you can use to access data in a [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] database. For a discussion of the different data-access technologies, see [Data Access Technologies Road Map](../connect-history.md)
23
+
OLE DB Driver for SQL Server is one technology you can use to access data in a [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] database. For a discussion of the different data-access technologies, see [Data Access Technologies Road Map](../connect-history.md).
24
24
25
-
When deciding whether to use OLE DB Driver for SQL Server as the data access technology of your application, you should consider several factors.
26
-
27
-
For new applications, if you're using a managed programming language such as Microsoft Visual C# or Visual Basic, and you need to access the new features in [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)], you should use the .NET Framework Data Provider for [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)], which is part of the .NET Framework.
28
-
29
-
If you are developing a COM-based application and need to access the new features introduced in [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)], you should use OLE DB Driver for SQL Server. If you don't need access to the new features of [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)], you can continue to use Windows Data Access Components (WDAC).
30
-
31
-
For existing OLE DB applications, the primary issue is whether you need to access the new features of [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)]. If you have a mature application that does not need the new features of [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)], you can continue to use WDAC. But if you do need to access those new features, such as the [xml data type](../../t-sql/xml/xml-transact-sql.md), you should use OLE DB Driver for SQL Server.
25
+
When you decide whether to use OLE DB Driver for SQL Server as the data access technology for your application, consider several factors.
26
+
27
+
For new applications, if you use a managed programming language such as Microsoft Visual C# or Visual Basic and need to access the new features in [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)], use the .NET Framework Data Provider for [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)], which is part of the .NET Framework.
28
+
29
+
If you develop a COM-based application and need to access the new features introduced in [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)], use OLE DB Driver for SQL Server. If you don't need access to the new features of [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)], you can continue to use Windows Data Access Components (WDAC).
30
+
31
+
For existing OLE DB applications, the primary issue is whether you need to access the new features of [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)]. If you have a mature application that doesn't need the new features of [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)], you can continue to use WDAC. But if you need to access those new features, such as the [xml data type](../../t-sql/xml/xml-transact-sql.md), use OLE DB Driver for SQL Server.
32
32
33
33
Both OLE DB Driver for SQL Server and MDAC support read committed transaction isolation using row versioning, but only OLE DB Driver for SQL Server supports snapshot transaction isolation. (In programming terms, read committed transaction isolation with row versioning is the same as Read-Committed transaction.)
34
34
35
35
For information about the differences between OLE DB Driver for SQL Server and MDAC, see [Updating an Application to OLE DB Driver for SQL Server from MDAC](../oledb/applications/updating-an-application-to-oledb-driver-for-sql-server-from-mdac.md).
36
36
37
-
## See Also
38
-
[OLE DB Driver for SQL Server](oledb-driver-for-sql-server.md)
39
-
[OLE DB How-to Topics](ole-db-how-to/ole-db-how-to-topics.md)
37
+
## Related content
38
+
39
+
-[OLE DB Driver for SQL Server](oledb-driver-for-sql-server.md)
40
+
-[OLE DB How-to Topics](ole-db-how-to/ole-db-how-to-topics.md)
Copy file name to clipboardExpand all lines: docs/odbc/reference/appendixes/sql-to-c-date.md
+26-16Lines changed: 26 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@ title: "SQL to C: Date"
3
3
description: "SQL to C: Date"
4
4
author: David-Engel
5
5
ms.author: davidengel
6
-
ms.date: "01/19/2017"
6
+
ms.date: 01/28/2026
7
7
ms.service: sql
8
8
ms.subservice: connectivity
9
9
ms.topic: reference
@@ -13,24 +13,34 @@ helpviewer_keywords:
13
13
- "data conversions from SQL to C types [ODBC], date"
14
14
---
15
15
# SQL to C: Date
16
-
The identifier for the date ODBC SQL data type is:
16
+
17
+
The identifier for the date ODBC SQL data type is:
18
+
19
+
SQL_TYPE_DATE
17
20
18
-
SQL_TYPE_DATE
19
-
20
-
The following table shows the ODBC C data types to which date SQL data may be converted. For an explanation of the columns and terms in the table, see [Converting Data from SQL to C Data Types](../../../odbc/reference/appendixes/converting-data-from-sql-to-c-data-types.md).
21
-
22
-
|C type identifier|Test|**TargetValuePtr*|**StrLen_or_IndPtr*|SQLSTATE|
21
+
The following table shows the ODBC C data types to which the driver can convert date SQL data. For an explanation of the columns and terms in the table, see [Converting Data from SQL to C Data Types](../../../odbc/reference/appendixes/converting-data-from-sql-to-c-data-types.md).
22
+
23
+
> [!NOTE]
24
+
> For character conversions, *BufferLength* must include space for the null terminator. A date string is 10 characters long (yyyy-mm-dd), so *BufferLength* must be at least 11 bytes to avoid truncation.
25
+
26
+
|C type identifier|Test|**TargetValuePtr*|**StrLen_or_IndPtr*|SQLSTATE|
|SQL_C_CHAR|*BufferLength* > Character byte length<br /><br /> 11 <= *BufferLength* <= Character byte length<br /><br /> *BufferLength* < 11|Data<br /><br /> Truncated data<br /><br /> Undefined|10<br /><br /> Length of data in bytes<br /><br /> Undefined|n/a<br /><br /> 01004<br /><br /> 22003|
25
29
|SQL_C_WCHAR|*BufferLength* > Character length<br /><br /> 11 <= *BufferLength* <= Character length<br /><br /> *BufferLength* < 11|Data<br /><br /> Truncated data<br /><br /> Undefined|10<br /><br /> Length of data in characters<br /><br /> Undefined|n/a<br /><br /> 01004<br /><br /> 22003|
26
30
|SQL_C_BINARY|Byte length of data <= *BufferLength*<br /><br /> Byte length of data > *BufferLength*|Data<br /><br /> Undefined|Length of data in bytes<br /><br /> Undefined|n/a<br /><br /> 22003|
27
-
|SQL_C_TYPE_DATE|None[a]|Data|6[c]|n/a|
28
-
|SQL_C_TYPE_TIMESTAMP|None[a]|Data[b]|16[c]|n/a|
29
-
30
-
[a]The value of *BufferLength* is ignored for this conversion. The driver assumes that the size of **TargetValuePtr* is the size of the C data type.
31
-
32
-
[b] The time fields of the timestamp structure are set to zero.
33
-
34
-
[c]This is the size of the corresponding C data type.
<sup>1</sup> The value of *BufferLength* is ignored for this conversion. The driver assumes that the size of **TargetValuePtr* is the size of the C data type.
35
+
36
+
<sup>2</sup> The driver sets the time fields of the timestamp structure to zero.
37
+
38
+
<sup>3</sup> This is the size of the corresponding C data type.
35
39
36
-
When date SQL data is converted to character C data, the resulting string is in the "*yyyy*-*mm*-*dd*" format. This format is not affected by the Windows country/region setting.
40
+
When the driver converts date SQL data to character C data, the resulting string is in the "*yyyy*-*mm*-*dd*" format. This format isn't affected by the Windows country/region setting.
41
+
42
+
## Related content
43
+
44
+
-[Converting Data from SQL to C Data Types](../../../odbc/reference/appendixes/converting-data-from-sql-to-c-data-types.md)
45
+
-[SQL to C: Timestamp](../../../odbc/reference/appendixes/sql-to-c-timestamp.md)
46
+
-[Data Type Identifiers and Descriptors](../../../odbc/reference/appendixes/data-type-identifiers-and-descriptors.md)
This rules checks that the blocked process threshold option is set to 0 (disabled) or set to a value higher than or equal to 5 (seconds). Setting the blocked process threshold option to a value from 1 to 4 can cause the deadlock monitor to run constantly. Values 1 to 4 should only be used for troubleshooting, and never long term or in a production environment without the assistance of [!INCLUDE [msCoName](../../includes/msconame-md.md)] Customer Service and Support.
17
+
This rule checks that the blocked process threshold option is set to 0 (disabled) or to a value of 5 seconds or higher. When you set the blocked process threshold to a value from 1 to 4, the deadlock monitor doesn't run because it only wakes every 5 seconds. If you configure the threshold to a value from 1 to 4, the system doesn't generate blocked process reports. Don't use values 1 to 4 in a production environment because they have no effect.
18
18
19
19
## Best practices recommendations
20
20
21
-
To resolve this problem, set the blocked process threshold option to a value of 5 (seconds) or higher, or disable blocked process threshold by setting the value to 0. To set the blocked process threshold to a value of`5` seconds, execute the following statement:
21
+
To resolve this issue, set the blocked process threshold option to a value of 5 seconds or higher, or disable it by setting the value to 0. To set the blocked process threshold to `5` seconds, execute the following statement:
0 commit comments