Microsoft ODBC Driver for SQL Server on Windows 的功能Features of the Microsoft ODBC Driver for SQL Server on Windows

下載下載 ODBC 驅動程式DownloadDownload ODBC Driver

Windows 上的 Microsoft ODBC Driver 17.4 for SQL ServerMicrosoft ODBC Driver 17.4 for SQL Server on Windows

ODBC 驅動程式 17.4 包括能夠調整 TCP Keep-Alive 設定。The ODBC Driver 17.4 includes the ability to adjust TCP Keep-Alive settings. 您可以將值新增至驅動程式或 DSN 登錄機碼來進行修改。They can be modified by adding values to the Driver or DSN registry keys. 這些機碼位於系統資料來源的 HKEY_LOCAL_MACHINE\Software\ODBC\,以及使用者資料來源的 HKEY_CURRENT_USER\Software\ODBC\ 中。The keys are located in HKEY_LOCAL_MACHINE\Software\ODBC\ for system data sources, and in HKEY_CURRENT_USER\Software\ODBC\ for user data sources. 若是 DSN,必須將值新增至 ...\Software\ODBC\ODBC.INI\<DSN Name>;若是驅動程式,則新增至 ...\Software\ODBC\ODBCINST.INI\ODBC Driver 17 for SQL ServerFor DSN the values need to be added to ...\Software\ODBC\ODBC.INI\<DSN Name> and for the Driver to ...\Software\ODBC\ODBCINST.INI\ODBC Driver 17 for SQL Server.

如需詳細資訊,請參閱 ODBC 元件的登錄項目See Registry Entries for ODBC Components for more information.

值為 REG_SZ,如下所示:The values are REG_SZ and are as follows:

  • KeepAlive 會藉由傳送 keep-alive 封包,控制 TCP 嘗試驗證閒置連線是否仍完整無缺的頻率。KeepAlive controls how often TCP attempts to verify that an idle connection is still intact by sending a keep-alive packet. 預設值為 30 秒。The default is 30 seconds.

  • KeepAliveInterval 可決定在收到回應之前,用以分隔 keep-alive 重新傳輸的間隔。KeepAliveInterval determines the interval separating keep-alive retransmissions until a response is received. 預設值為 1 秒。The default is 1 second.

Windows 上的 Microsoft ODBC Driver 13.1 for SQL ServerMicrosoft ODBC Driver 13.1 for SQL Server on Windows

ODBC Driver 13.1 for SQL Server 包含舊版 (11) 的所有功能,並且增加對 Always Encrypted 和 Azure Active Directory 驗證的支援,這些是搭配 Microsoft SQL Server 2016 使用的新功能。The ODBC Driver 13.1 for SQL Server contains all the functionality of the previous version (11) and adds support for Always Encrypted and Azure Active Directory authentication when used in conjunction with Microsoft SQL Server 2016.

一律加密可讓用戶端將用戶端應用程式內的機密資料進行加密,且永遠不會顯示 SQL Server 的加密金鑰。Always Encrypted allows clients to encrypt sensitive data inside client applications and never reveal the encryption keys to SQL Server. 安裝在用戶端電腦上且啟用一律加密的驅動程式,透過自動將 SQL Server 用戶端應用程式中的機密資料進行加密與解密,進而達成此目的。An Always Encrypted enabled driver installed on the client computer achieves this by automatically encrypting and decrypting sensitive data in the SQL Server client application. 驅動程式會先將敏感資料行中的資料進行加密,才會將資料傳遞至 SQL Server,並自動重寫查詢以保留應用程式的語意。The driver encrypts the data in sensitive columns before passing the data to SQL Server, and automatically rewrites queries so that the semantics to the application are preserved. 同樣地,驅動程式會以透明的方式,將查詢結果中加密資料庫資料行所儲存的資料進行解密。Similarly, the driver transparently decrypts data stored in encrypted database columns that are contained in query results. 如需詳細資訊,請參閱搭配 ODBC 驅動程式使用 Always EncryptedFor more information, see Using Always Encrypted with the ODBC Driver.

Azure Active Directory 可讓使用者、DBA 和應用程式設計人員透過 Azure Active Directory (Azure AD) 中的身分識別,使用 Azure Active Directory 驗證作為連線到 Microsoft Azure SQL Database 與 Microsoft SQL Server 2016 的機制。Azure Active Directory allows users, DBA's, and application programmers to use Azure Active Directory authentication as a mechanism of connecting to Microsoft Azure SQL Database and Microsoft SQL Server 2016 by using identities in Azure Active Directory (Azure AD). 如需詳細資訊,請參閱搭配 ODBC 驅動程式使用 Azure Active Directory使用 Azure Active Directory 驗證連線到 SQL Database 或 Azure Synapse AnalyticsFor more information, see Using Azure Active Directory with the ODBC Driver, and Connecting to SQL Database or Azure Synapse Analytics By Using Azure Active Directory Authentication.

Windows 上的 Microsoft ODBC Driver 11 for SQL ServerMicrosoft ODBC Driver 11 for SQL Server on Windows

ODBC Driver for SQL ServerSQL Server 包含隨附於 SQL Server 2012 (11.x)SQL Server 2012 (11.x)SQL ServerSQL Server Native Client ODBC 驅動程式的所有功能。The ODBC Driver for SQL ServerSQL Server contains all the functionality of the SQL ServerSQL Server Native Client ODBC driver that shipped in SQL Server 2012 (11.x)SQL Server 2012 (11.x). 如需詳細資訊,請參閱 SQL Server Native Client 程式設計For more information, see SQL Server Native Client Programming. SQL ServerSQL Server Native Client ODBC 驅動程式以 Windows 作業系統中隨附的 ODBC 驅動程式作為基礎。The SQL ServerSQL Server Native Client ODBC driver is based on the ODBC driver that ships in the Windows operating system. 如需詳細資訊,請參閱 Windows Data Access Components SDKFor more information, see Windows Data Access Components SDK.

此版本的 ODBC Driver for SQL ServerSQL Server 包含下列新功能:This release of the ODBC Driver for SQL ServerSQL Server contains the following new features:

bcp.exe -l 選項,用於指定登入逾時bcp.exe -l option for specifying a login timeout

-l 選項會指定在您嘗試連線到伺服器時,bcp.exe 登入 SQL ServerSQL Server 的逾時秒數。The -l option specifies the number of seconds before a bcp.exe login to SQL ServerSQL Server times out when you try to connect to a server. 預設登入逾時為 15 秒。The default login timeout is 15 seconds. 登入逾時必須是介於 0 與 65534 之間的數字。The login timeout must be a number between 0 and 65534. 如果所提供的值不是數值或不在該範圍內,bcp.exe 就會產生錯誤訊息。If the value supplied is not numeric or does not fall into that range, bcp.exe generates an error message. 值為 0 會指定無限逾時。A value of 0 specifies an infinite timeout. 小於 (約) 10 秒的登入逾時不可靠。A login timeout of less than (approximately) 10 seconds is not reliable.

可感知驅動程式的連接共用Driver-Aware Connection Pooling

ODBC Driver for SQL ServerSQL Server支援可感知驅動程式的連線共用The ODBC Driver for SQL ServerSQL Server supports Driver-Aware Connection Pooling. 如需詳細資訊,請參閱 ODBC Driver for SQL Server 中可感知驅動程式的連接共用For more information, see Driver-Aware Connection Pooling in the ODBC Driver for SQL Server.

非同步執行 (通知方法)Asynchronous Execution (Notification Method)

ODBC Driver for SQL ServerSQL Server支援非同步執行 (通知方法)The ODBC Driver for SQL ServerSQL Server supports Asynchronous Execution (Notification Method). 如需使用範例,請參閱非同步執行 (通知方法) 範例For a usage sample, see Asynchronous Execution (Notification Method) Sample.

連接恢復功能Connection Resiliency

若要確保應用程式仍然連接到 Microsoft Azure SQL Database,Windows 上的 ODBC 驅動程式可以還原閒置的連接。To ensure that applications remain connected to a Microsoft Azure SQL Database, the ODBC driver on Windows can restore idle connections. 如需詳細資訊,請參閱 Windows ODBC 驅動程式中的連接恢復功能For more information, see Connection Resiliency in the Windows ODBC Driver.

行為變更Behavior Changes

SQL ServerSQL Server Native Client 中,sqlcmd.exe-y0 選項會在顯示寬度為 0 時,將輸出截斷為 1 MB。In SQL ServerSQL Server Native Client, the -y0 option for sqlcmd.exe caused output to be truncated at 1 MB if the display width was 0.

從 ODBC Driver 11 for SQL ServerSQL Server 開始,在已指定 -y0 的情況下,單一資料行中已沒有可擷取資料量的限制。Beginning in the ODBC Driver 11 for SQL ServerSQL Server, there is no limit on the amount of data that can be retrieved in a single column when -y0 is specified. sqlcmd.exe 現在會串流多達 2 GB 的資料行 (SQL ServerSQL Server 最大資料類型)。sqlcmd.exe now streams columns as large as 2 GB (SQL ServerSQL Server data type maximum).

另一項差異是,同時指定 -h-y0 現在會產生選項不相容的錯誤報告。Another difference is that specifying both -h and -y0 now produces an error reporting that the options are incompatible. -h 會指定要在欄位標題間列印的資料列數目,且從不與 -y0 相容,該項目雖然不會列印標題,但是遭到忽略。-h, which specifies the number of rows to print between the column headings and has never been compatible with -y0, was ignored although no headers were printed.

請注意,依照傳回的資料大小,-y0 可能導致伺服器和網路都發生效能問題。Note that -y0 can cause performance issues on both the server and the network, depending on the size of the data returned.

另請參閱See Also

Windows 上的 Microsoft ODBC Driver for SQL ServerMicrosoft ODBC Driver for SQL Server on Windows