SQL Server and ODBC
Open Database Connectivity (ODBC) is a Call-Level Interface (CLI) that allows C and C++ applications to access data from ODBC data sources. A CLI is an API consisting of functions an application calls to obtain a set of services. ODBC data sources include data stored in different formats, not just SQL databases. An application uses an ODBC driver to access a data source. An ODBC driver is a dynamic-link library (DLL) that accepts calls to the ODBC API functions and does whatever is necessary to process that request against the data source.
ODBC is aligned with these specifications and standards defining a CLI for data access:
- The X/Open CAE Specification "Data Management: SQL Call-Level Interface (CLI)"
- ISO/IEC 9075-3:1995(E) Call-Level Interface (SQL/CLI)
ODBC has been widely accepted by database programmers, and several database vendors or third-party companies supply ODBC drivers. Several other Microsoft data access APIs were defined as simplified object models over ODBC, such as:
- Remote Data Objects (RDO)
- Data Access Objects (DAO)
- Microsoft Foundation Classes (MFC) Database Classes
Microsoft® SQL Server™ 2000 includes a native Microsoft SQL Server ODBC driver used by ODBC applications to access the data in SQL Server. The SQL Server ODBC Driver complies with Level 2 of the ODBC 3.51 specification and exposes all the features of SQL Server. In SQL Server 2000 all of the SQL Server utilities except isql use the ODBC API and the SQL Server ODBC Driver.
ODBC can be used in tools, utilities, or system level development needing either top performance or access to SQL Server features, and which are not COM applications. ODBC, like OLE DB, allows individual drivers to define driver-specific mechanisms to support additional features of the data engine accessed by the driver. These features include:
- A set of bulk copy functions based on the earlier DB-Library bulk copy functions.
- Extensions to the ODBC diagnostic functions and records to get SQL Server-specific information from messages and errors.
- A set of functions that exposes catalog information from the linked servers used in SQL Server distributed queries.
- Various driver-specific attributes and connection string keywords to control SQL Server–specific behaviors.