OLE DB Indexes (SQL Server Compact)

Microsoft SQL Server Compact 4.0 supports indexes and several index-based operations to improve application performance.

Using Indexes

When you work with indexes in SQL Server Compact 4.0, you must consider the following issues:

  • SQL Server Compact 4.0 supports only "integrated indexes" as defined in the Microsoft OLE DB documentation. This means that the index is logically part of the Rowset object and is used to order the rowset. No separate index rowset is used to provide ordering.

  • Indexes in SQL Server Compact 4.0 have slightly different creation properties from Microsoft SQL Server.

  • The name of the index is the only characteristic of an index that can be modified by using IAlterIndex::AlterIndex against the OLE DB provider for SQL Server Compact 4.0.

  • To dynamically change the index while the rowset is open, you must request DBPROP_IRowsetCurrentIndex with a value of VARIANT_TRUE when you open the base table rowset. For more information, see Changing Indexes with OLE DB.

  • To the Seek and SetRange methods of the IRowsetIndex interface, you must request the property DBPROP_IRowsetIndex with a value of VARIANT_TRUE when you open the base table rowset.

See Also

Reference

Creating Indexes with OLE DB

Using the Seek Method with OLE DB