다음을 통해 공유


Learning SQL Server Native Client

What is SQL Server Native Client?

Microsoft SQL Server Native Client contains the SQL ODBC driver and SQL OLE DB provider in one native dynamic link library (DLL) supporting applications using native-code APIs (ODBC, OLE DB and ADO) to Microsoft SQL Server. SQL Server Native Client was introduced in Microsoft SQL Server 2005 to provide new functionality above and beyond that supplied by the Microsoft Data Access Components (MDAC). SQL Server Native Client should be used to create new applications or enhance existing applications that want to take advantage of SQL Server features such as database mirroring, multiple active result sets (MARS), query notifications, snapshot isolation, and XML data type support. For more information, about the new features supported by SQL Server Native Client, see Features of SQL Server Native Client and Native API for SQL Server FAQ.

Does SQL Server Native Client require MDAC and if so what version?

SQL Server Native Client provides a way to innovate and evolve new data access features without changing the current MDAC components, which are now part of the Microsoft Windows platform. The SQL Server Native Client ODBC driver is always used in conjunction with the ODBC Driver Manager supplied with MDAC. The SQL Server Native Client OLE DB provider may be used in conjunction with OLE DB Core Services supplied with MDAC, but this is not a requirement. The choice to use Core Services or not depends on the requirements of the individual application (for example, if connection pooling is required). SQL Server Native Client uses the version of MDAC supplied by the OS release support by SQL Server Native Client. For a list of the differences between SQL Server Native Client and MDAC, plus information about issues to consider before updating an MDAC application to SQL Server Native Client, see Updating an Application to SQL Server Native Client from MDAC.

Can I use ADO with SQL Server Native Client?

ActiveX Data Objects (ADO) applications may use the SQL Server Native Client OLE DB provider, but it is recommended to use it in conjunction with the DataTypeCompatibility connection string keyword (or its corresponding DataSource property). When using the SQL Server Native Client OLE DB provider, ADO applications may exploit those features of SQL Server that are available through the SQL Server Native Client via connection string keywords, OLE DB properties, or Transact-SQL. For more information about the use of these features with ADO, see Using ADO with SQL Server Native Client.

Which interface is right for me?

If you are accessing data from C/C++, both ODBC and OLEDB are good options, and many factors could come into play making a decision. Therefore, we recommend reading about both and seeing which is better suited to the needs, architecture, and programming style of your application. If interoperability with other systems and platforms is important to you or you are migrating existing native code applications from other systems or platforms, ODBC is the better choice. For new application development, a managed code solution based on the .NET Framework using ADO.NET for data access will be the best choice in most cases. However, if you have existing native business logic and associated data access code, then it is feasible to re-use this and only replace the user interface layer.

How do I deploy SQL Server Native Client?

When deploying an application that is dependent on SQL Server Native Client, you will need to redistribute SQL Server Native Client with your application. Unlike Microsoft Data Access Components (MDAC), which is now a component of the operating system, SQL Server Native Client is a component of SQL Server. Therefore, it is important to install SQL Server Native Client in your development environment and redistribute SQL Server Native Client with your application. SQL Server Native Client redistributable installation program, named sqlncli.msi, is available on the SQL Server installation media and is available as one of the SQL Server Feature Pack components on the Microsoft Download site. For more information about deploying SQL Server Native Client with your application, see Deploying Applications with SQL Server Native Client.

Topic Areas

  • What is SQL Native Client?
  • Does SQL Native Client require MDAC and if so what version?
  • Can I use ADO with SQL Native Client?
  • Which interface is right for me?
  • How do I deploy SQL Native Client?