简体   繁体   English

ODBC 驱动程序的驱动程序之间的差异

[英]Differences Between Drivers for ODBC Drivers

I was setting up the System DSN (64 bit) for my database in SQL server 2016 with Windows 10 64 bit pro.我正在使用 Windows 10 64 位专业版在 SQL Server 2016 中为我的数据库设置系统 DSN(64 位)。 While I was asked to choose the driver to set up a data source, there are the following selections:当我被要求选择驱动程序来设置数据源时,有以下选择:

  • ODBC Driver 13 for SQL Server用于 SQL Server 的 ODBC 驱动程序 13
  • SQL Server数据库服务器
  • SQL Server Native Client 11.0 SQL Server 本机客户端 11.0
  • SQL Server Native Client RDA 11.0 SQL Server 本机客户端 RDA 11.0

It seemed I can set up the data source with all of these drivers.似乎我可以使用所有这些驱动程序设置数据源。 Then which one should I choose in terms of speed and efficiency?那么速度和效率应该选择哪一个呢? What's the difference between them?它们之间有什么区别?

Thanks,谢谢,

Jason杰森

ODBC Driver for SQL Server SQL Server 的 ODBC 驱动程序

ODBC is the primary native data access API for applications written in C,C++, PHP, Python and others for connecting to SQL Server. ODBC 是主要的本地数据访问 API,用于使用 C、C++、PHP、Python 和其他语言编写的应用程序连接到 SQL Server。

It's widely used in data integration scenarios.广泛应用于数据集成场景。

Also, it's preferred if you are developing application on Windows and deploying it to Linux .此外,如果您在 Windows 上开发应用程序并将其部署到 Linux ,则首选。

SQL Server数据库服务器

The full name of SQL Server Driver is SQL Server ODBC Driver. SQL Server Driver 的全称是 SQL Server ODBC Driver。 It's an old driver since sql 2000. You can use it to connect to SQL Server 2016, but you will not be able to access new features and functionality of SQL Server 2016这是自 sql 2000 以来的旧驱动程序。您可以使用它连接到 SQL Server 2016,但您将无法访问 SQL Server 2016 的新特性和功能

SQL Server Native Client SQL Server 本机客户端

SQL Server Native Client is containing both the SQL OLE DB provider and SQL ODBC driver to support native connectivity to SQL Server and support all features of sql server 2016. It's the best in windows environment SQL Server Native Client 包含 SQL OLE DB 提供程序和 SQL ODBC 驱动程序,以支持与 SQL Server 的本地连接并支持 sql server 2016 的所有功能。它是 Windows 环境中的最佳选择

SQL Server Native Client RDA SQL Server 本机客户端 RDA

Remote data access (RDA) in Microsoft SQL Server Compact 3.5 lets an application access data from a remote SQL Server database table. Microsoft SQL Server Compact 3.5 中的远程数据访问 (RDA) 允许应用程序访问远程 SQL Server 数据库表中的数据。

It can also store, read, and update that data in SQL Server Compact 3.5, and then update the original SQL Server table.它还可以在 SQL Server Compact 3.5 中存储、读取和更新该数据,然后更新原始 SQL Server 表。

RDA will be removed in the future release, so avoid using it. RDA 将在未来版本中删除,因此请避免使用它。

So choose sql driver based on the criteria above.所以根据上面的标准选择sql驱动。

Microsoft ODBC Driver for SQL Server (MSODBCSQL) 适用于 SQL Server 的 Microsoft ODBC 驱动程序(MSODBCSQL)

This driver was announced in 2013 as the successor to SQL Server Native Client.该驱动程序于 2013 年作为 SQL Server Native Client 的继任者发布 It is installed with recent SQL Server versions.它与最新的 SQL Server 版本一起安装。 There are standalone installers for clients.客户端有独立的安装程序 Driver history for Microsoft SQL Server recommends this driver in preference to "SQL Server" and "SQL Server Native Client" for ODBC. Microsoft SQL Server 的驱动程序历史推荐此驱动程序优先于 ODBC 的“SQL Server”和“SQL Server Native Client”。 Added features over "SQL Server Native Client": driver-aware connection pooling, connection resiliency, asynchronous execution (polling), support for Always Encrypted , recent SQL Server compatibility (including Azure SQL), and more supported operating systems (including Linux and macOS ).在“SQL Server Native Client”上增加了功能:驱动感知连接池、连接弹性、异步执行(轮询)、支持Always Encrypted 、最近的SQL Server 兼容性(包括 Azure SQL)以及更多支持的操作系统(包括Linux 和 macOS) )。 You can follow current development on the SQL Server Blog (with previous posts on theSQLNCli team blog ).您可以在SQL Server 博客上关注当前的开发(以及SQLNCli 团队博客上的先前帖子)。

Driver={ODBC Driver XX for SQL Server} ( XX replaced by driver version. See System Requirements, Installation, and Driver Files .) Driver={ODBC Driver XX for SQL Server}XX替换为驱动程序版本。请参阅系统要求、安装和驱动程序文件。)

SQL Server Native Client (SQLNCLI) SQL Server 本机客户端(SQLNCLI)

Introduced with SQL Server 2005 and ships with SQL Server (also installable via sqlncli.msi from SQL Server feature packs ).随 SQL Server 2005 引入并随 SQL Server 一起提供(也可通过 SQL Server 功能包中的sqlncli.msi安装)。 Added features over "SQL Server": Multiple active result sets (MARS), user-defined data types (UDT), query notifications, snapshot isolation, and XML data type support.在“SQL Server”之上添加的功能:多个活动结果集 (MARS)、用户定义的数据类型 (UDT)、查询通知、快照隔离和 XML 数据类型支持。 The version for SQL Server 2008 also added support for the new date and time types . SQL Server 2008 版本还增加了对新日期和时间类型的支持

Driver={SQL Server Native Client} (SQL Server 2005) Driver={SQL Server Native Client} (SQL Server 2005)
Driver={SQL Server Native Client 10.0} (SQL Server 2008) Driver={SQL Server Native Client 10.0} (SQL Server 2008)
Driver={SQL Server Native Client 11.0} (SQL Server 2012 and later) Driver={SQL Server Native Client 11.0} (SQL Server 2012 及更高版本)

SQL Server Native Client RDA SQL Server 本机客户端 RDA

Remote Data Access (RDA) is a SQL Server Compact feature which "lets an application access data from a remote SQL Server database table."远程数据访问 (RDA) 是 SQL Server Compact 的一项功能,它“允许应用程序访问远程 SQL Server 数据库表中的数据”。 I can't find much documentation, but it appears this driver was intended to support replication scenarios with Compact Edition.我找不到太多文档,但似乎此驱动程序旨在支持 Compact Edition 的复制方案。

SQL Server (SQLSRV32) SQL Server (SQLSRV32)

Included in Microsoft Data Access Components (MDAC) (now called Windows Data Access Components (WDAC)).包含在Microsoft 数据访问组件 (MDAC) (现在称为 Windows 数据访问组件 (WDAC))中。 This driver is available by default on Windows (since 98 and NT 4.0).默认情况下,此驱动程序在 Windows 上可用(自 98 和 NT 4.0 起)。

Driver={SQL Server}

To check which drivers you have installed, fire up an powershell (32/64 bit - depending which driver architecture you want to use) and run要检查您安装了哪些驱动程序,请启动一个 powershell(32/64 位 - 取决于您要使用的驱动程序架构)并运行

OLEDB有机发光二极管

(New-Object System.Data.OleDb.OleDbEnumerator).GetElements() | select SOURCES_NAME, SOURCES_DESCRIPTION

ODBC ODBC

Get-OdbcDriver | select Name,Platform

Overview概述

https://docs.microsoft.com/en-us/sql/connect/connect-history#odbc https://docs.microsoft.com/en-us/sql/connect/connect-history#odbc

There are three distinct generations of Microsoft ODBC drivers for SQL Server. SQL Server 有三代不同的 Microsoft ODBC 驱动程序。

  • The first "SQL Server" ODBC driver still ships as part of Windows Data Access Components.第一个“SQL Server”ODBC 驱动程序仍作为 Windows 数据访问组件的一部分提供。 It is not recommended to use this driver for new development.不建议在新开发中使用此驱动程序。
  • Starting in SQL Server 2005, the SQL "Server Native Client 10.x/11.x/12.x" includes an ODBC interface and is the ODBC driver that shipped with SQL Server 2005 through SQL Server 2012. It is not recommended to use this driver for new development.从 SQL Server 2005 开始,SQL“Server Native Client 10.x/11.x/12.x”包含一个 ODBC 接口,是 SQL Server 2005 到 SQL Server 2012 随附的 ODBC 驱动程序。不建议使用这种新发展的驱动力。
  • After SQL Server 2012, the Microsoft ODBC Driver for SQL Server is the driver that is updated with the most recent server features going forward .在 SQL Server 2012 之后,用于 SQL Server 的 Microsoft ODBC 驱动程序是更新了最新服务器功能的驱动程序。

SQL Server数据库服务器

It's the old one from the MDAC-package ( https://support.microsoft.com/en-us/help/899456 ) which now (since XP/2003) comes with the Windows-OS.这是 MDAC 包 ( https://support.microsoft.com/en-us/help/899456 ) 中的旧版本,现在(自 XP/2003 起)随 Windows-OS 一起提供。 https://docs.microsoft.com/en-us/sql/connect/connect-history#mdacwdac-releases https://docs.microsoft.com/en-us/sql/connect/connect-history#mdacwdac-releases

https://docs.microsoft.com/en-us/sql/relational-databases/native-client/applications/updating-an-application-to-sql-server-native-client-from-mdac https://docs.microsoft.com/en-us/sql/relational-databases/native-client/applications/updating-an-application-to-sql-server-native-client-from-mdac

...starting with Windows Vista, the data access components are now called Windows Data Access Components, or Windows DAC). ...从 Windows Vista 开始,数据访问组件现在称为 Windows 数据访问组件,或 Windows DAC)。 Although both provide native data access to SQL Server databases, SQL Server Native Client has been specifically designed to expose the new features of SQL Server 2005 (9.x), while at the same time maintaining backward compatibility with earlier versions.尽管两者都提供对 SQL Server 数据库的本机数据访问,但 SQL Server Native Client专门设计用于公开 SQL Server 2005 (9.x)的新功能,同时保持与早期版本的向后兼容性。


SQL Server Native Client SQL Server 本机客户端

https://docs.microsoft.com/en-us/sql/connect/connect-history#odbc https://docs.microsoft.com/en-us/sql/connect/connect-history#odbc

SQL Server Native Client is a stand-alone library that is used for both OLE DB and ODBC. SQL Server Native Client 是一个用于 OLE DB 和 ODBC 的独立库。 SQL Server Native Client (often abbreviated SNAC) was included in SQL Server 2005 through 2012. SQL Server Native Client can be used for applications that need to take advantage of new features introduced in SQL Server 2005 through SQL Server 2012 . SQL Server Native Client(通常缩写为 SNAC)包含在 SQL Server 2005 到 2012 中。SQL Server Native Client 可用于需要利用SQL Server 2005 到 SQL Server 2012 中引入的新功能的应用程序。 (Microsoft/Windows Data Access Components are not updated for these new features in SQL Server.) For new features beyond SQL Server 2012, SQL Server Native Client will not be updated. (Microsoft/Windows 数据访问组件不会针对 SQL Server 中的这些新功能进行更新。)对于 SQL Server 2012 之后的新功能,不会更新 SQL Server Native Client。 Switch to the Microsoft ODBC Driver for SQL Server or the Microsoft OLE DB Driver for SQL Server if you want to take advantage of new SQL Server features going forward.如果您想利用未来的新 SQL Server 功能,请切换到 Microsoft ODBC Driver for SQL Server 或 Microsoft OLE DB Driver for SQL Server。


SQL Server Native Client RDA SQL Server 本机客户端 RDA

Came with .NET Compact Framework 3.5附带 .NET Compact Framework 3.5


ODBC Driver for SQL Server SQL Server 的 ODBC 驱动程序

https://docs.microsoft.com/en-us/sql/connect/connect-history#odbc https://docs.microsoft.com/en-us/sql/connect/connect-history#odbc

After SQL Server 2012, the primary ODBC driver for SQL Server has been developed and released as the Microsoft ODBC Driver for SQL Server.在 SQL Server 2012 之后,SQL Server的主要 ODBC 驱动程序已经开发并发布为 Microsoft ODBC Driver for SQL Server。


MSOLEDBSQL - Microsoft OLE DB Driver for SQL Server MSOLEDBSQL - 用于 SQL Server 的 Microsoft OLE DB 驱动程序

This driver has been deprecated and later undeprecated :该驱动程序已经过时,后来undeprecated

https://docs.microsoft.com/en-us/sql/connect/oledb/oledb-driver-for-sql-server#3-microsoft-ole-db-driver-for-sql-server-msoledbsql https://docs.microsoft.com/en-us/sql/connect/oledb/oledb-driver-for-sql-server#3-microsoft-ole-db-driver-for-sql-server-msoledbsql

The new OLE DB provider is called the Microsoft OLE DB Driver for SQL Server (MSOLEDBSQL).新的 OLE DB 提供程序称为 Microsoft OLE DB Driver for SQL Server (MSOLEDBSQL)。 The new provider will be updated with the most recent server features going forward.新的提供程序将使用最新的服务器功能进行更新。 To use the new Microsoft OLE DB Driver for SQL Server in existing applications, you should plan to convert your connection strings from SQLOLEDB or SQLNCLI, to MSOLEDBSQL.要在现有应用程序中使用新的 Microsoft OLE DB Driver for SQL Server,您应该计划将连接字符串从 SQLOLEDB 或 SQLNCLI 转换为 MSOLEDBSQL。 https://blogs.msdn.microsoft.com/sqlnativeclient/2018/03/30/released-microsoft-ole-db-driver-for-sql-server/ https://blogs.msdn.microsoft.com/sqlnativeclient/2018/03/30/released-microsoft-ole-db-driver-for-sql-server/


Summary总结

Try to use the future proof drivers:尝试使用面向未来的驱动程序:

SQL Server Native client vs .NET Framework Data Provider for ODBC用于 ODBC 的 SQL Server 本机客户端与 .NET Framework 数据提供程序

It seems that for last version for SQL Server Native client, the Microsoft® SQL Server® 2012 Native Client also named as SQL Server native client 11.0.对于 SQL Server Native 客户端的最新版本,Microsoft® SQL Server® 2012 Native Client 似乎也被命名为 SQL Server Native Client 11.0。 Doesn't support new feature in SQL Server 2014 or later不支持 SQL Server 2014 或更高版本中的新功能

Note that SNAC 11 does not support features released with SQL Server 2014 and SQL Server 2016 that were not available as part of SQL Server 2012, such as Transparent Network IP Resolution, Always Encrypted, Azure AD Authentication, Bulk Copy and Table Value Parameters.请注意,SNAC 11 不支持随 SQL Server 2014 和 SQL Server 2016 发布的、作为 SQL Server 2012 的一部分不可用的功能,例如透明网络 IP 解析、始终加密、Azure AD 身份验证、大容量复制和表值参数。

https://blogs.msdn.microsoft.com/sqlreleaseservices/snac-lifecycle-explained/ https://blogs.msdn.microsoft.com/sqlreleaseservices/snac-lifecycle-explained/

You have to use Microsoft® ODBC Driver 11 or 13 for SQL Server to enjoy new feature in SQL Server 2014 or later您必须使用 Microsoft® ODBC Driver 11 或 13 for SQL Server 才能享受 SQL Server 2014 或更高版本的新功能

As mentioned earlier in this post, the later version of the ODBC driver (13 and after) give you access to the more advanced features available in SQL Server 2014, 2016, etc.正如本文前面提到的,更高版本的 ODBC 驱动程序(13 及更高版本)使您可以访问 SQL Server 2014、2016 等中可用的更高级功能。

However, there are conflicting Microsoft posts on whether the ODBC Version 17 driver supports SQL Server 2012 or not.但是,关于 ODBC 版本 17 驱动程序是否支持 SQL Server 2012 的 Microsoft 帖子存在冲突。

This link says you have to use ODBC 13 for SQL Server 2012: SQL Server Driver Versions此链接说您必须将 ODBC 13 用于 SQL Server 2012: SQL Server 驱动程序版本

However, if you look at the download for the ODBC Version 17, it indicates it support for SQL Server 2012 (and older versions of SQL Server).但是,如果您查看 ODBC 版本 17 的下载,它表明它支持 SQL Server 2012(和旧版本的 SQL Server)。

Microsoft® ODBC Driver 17 for SQL Server® - Windows, Linux, & macOS Microsoft® ODBC Driver 17 for SQL Server® - Windows、Linux 和 macOS

ODBC 驱动程序 - 详细信息部分

So perhaps the ODBC Version 17 driver is (at least) backwards compatible with older versions of SQL Server.因此,也许 ODBC 版本 17 驱动程序(至少)向后兼容旧版本的 SQL Server。

Hope this helps!希望这有帮助!

Jon乔恩

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 连接到SQL Server时OLEDB / ODBC驱动程序之间有什么区别? - What are the differences between OLEDB/ODBC drivers when connecting to SQL Server? 在Linux中配置ODBC驱动程序 - Configure ODBC drivers in Linux Mac OS X 10.6 ODBC驱动程序 - Mac OS X 10.6 ODBC Drivers 如何设置项目以使用odbc和mssql驱动程序? - How to setup project to work with odbc and mssql drivers? ODBC 驱动程序错误地格式化日期字段的问题 - Issues with ODBC Drivers formatting date fields incorrectly 无法在 Linux 上使用 ODBC 驱动程序连接 SQL Server - Unable to connect SQL Server with ODBC drivers on linux ms sql microsoft 的 jdbc 驱动程序和 jTDS 的驱动程序之间的区别 - differences between ms sql microsoft's jdbc drivers and jTDS's driver pyodbc.drivers() 返回驱动程序列表,但我的 python 脚本没有与列出的任何 ODBC 驱动程序一起运行 - pyodbc.drivers() returns the list of drivers but my python script isn't running with any ODBC driver listed 使用本地计算机上的ODBC驱动程序连接到MS SQL数据库 - Connecting to MS SQL database using ODBC drivers from local machine 将 SQL Server 的 Linux ODBC 驱动程序添加到 Kaggle/Python docker 映像 - Adding Linux ODBC drivers for SQL Server to a Kaggle/Python docker image
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM