The following table lists all of the OLE DB interfaces used by SQL Server. The Required column indicates whether the interface is part of the bare minimum OLE DB functionality that SQL Server needs or whether it is optional. If a given interface is not marked as required, SQL Server can still access the provider, but some specific SQL Server functionality or optimization is not possible against the provider.
In the case of the optional interfaces, the Scenarios column indicates one or more of the scenarios that use the specified interface. For example, the IRowsetChange interface on base table rowsets is an optional interface; this interface is used in the UPDATE and DELETE statements and INSERT statement scenarios. If this interface is not supported, UPDATE, DELETE, and INSERT statements cannot be supported against that provider. Some of the other optional interfaces are marked “performance” in the Scenarios column, indicating that the interface results in better general performance. For example, if the IDBSchemaRowset interface is not supported, SQL Server must open the rowset twice: once for its metadata and once for query execution. By supporting IDBSchemaRowset, SQL Server performance is improved.
Object | Interface | Required | Comments | Scenarios |
---|---|---|---|---|
Data Source | IDBInitialize | Yes | Initialize and set up data and security context. | |
IDBCreateSession | Yes | Create DB session object. | ||
IDBProperties | Yes | Get information about capabilities of provider, set initialization properties, required property: DBPROP_INIT_TIMEOUT. | ||
IDBInfo | No | Get quoting literal, catalog, name, part, separator, character, and so on. | Remote query. | |
DB Session | IDBSchemaRowset | No | Get table/column metadata. Rowsets needed: TABLES, COLUMNS, PROVIDER_TYPES; others that are used if available: INDEXES. |
Performance, indexed access. |
IOpenRowset | Yes | Open a rowset on a table/index. | ||
IGetDataSource | Yes | Use to get back to the DSO from a DB session object. | ||
IDBCreateCommand | No | Use to create a command object (query) for providers that support querying. | Remote query, pass-through query. | |
ITransactionLocal | No | Use for transacted updates. | UPDATE and DELETE, INSERT statements. | |
ITransactionJoin | No | Use for distributed transaction support. | UPDATE and DELETE, INSERT statements if in a user transaction. | |
Rowset | IRowset | Yes | Scan rows. | |
IAccessor | Yes | Bind to columns in a rowset. | ||
IColumnsInfo | Yes | Get information about columns in a rowset. | ||
IRowsetInfo | Yes | Get information about rowset properties. | ||
IRowsetLocate | No | Needed for UPDATE/DELETE operations and to do index-based lookups; used to look up rows by bookmarks. | Indexed access, UPDATE and DELETE statements. | |
IRowsetChange | No | Needed for INSERTS/UPDATES/ DELETES on a rowset. Rowsets against base tables should support this interface for INSERT, UPDATE and DELETE statements. |
UPDATE and DELETE, INSERT statements. | |
IConvertType | Yes | Use to verify whether the rowset supports specific data type conversions on its columns. | ||
Index | IRowset | Yes | Scan rows. | Indexed access, performance. |
IAccessor | Yes | Bind to columns in a rowset. | Indexed access, performance. | |
IColumnsInfo | Yes | Get information about columns in a rowset. | Indexed access, performance. | |
IRowsetInfo | Yes | Get information about rowset properties. | Indexed access, performance. | |
IRowsetIndex | Yes | Needed only for rowsets on an index; used for indexing functionality (set range, seek). | Indexed access, performance. | |
Command | ICommand | Yes | Remote query, pass-through query. | |
ICommandText | Yes | Use for defining the query text. | Remote query, pass-through query. | |
IColumnsInfo | Yes | Use for getting column metadata for query results. | Remote query, pass-through query. | |
ICommandProperties | Yes | Use to specify required properties on rowsets returned by the command. | Remote query, pass-through query. | |
ICommandWithParameters | No | Use for parameterized query execution. | Remote query, performance. | |
ICommandPrepare | No | Use for preparing a command to get metadata (used in pass-through queries if available). | Remote query, performance. | |
Error | IErrorRecords | Yes | Use for getting a pointer to an IErrorInfo interface corresponding to a single error record. | |
IErrorInfo | Yes | Use for getting a pointer to an IErrorInfo interface corresponding to a single error record. | ||
Any object | ISupportErrorInfo | No | Use to verify whether a given interface supports error objects. |
Note The Index object, Command object, and Error object are not mandatory. However, if they are supported, the listed interfaces are mandatory as specified in the Required column.