ADO.NET Provider for Excel Services

Build 20.0.7587

Index Columns

The IndexColumns schema collection lists the indexes and their corresponding columns. By filtering on indexes, you can write more selective queries with faster query response times.

Retrieving Index Column Information

To retrieve this schema collection, call the GetSchema method of the ExcelServicesConnection class. You can restrict the results by table name. The following example retrieves the column and sequence number for each index of the Excel Services table Account.


String connectionString = "Url=;;Password=password;File=Book1.xlsx;";

using (ExcelServicesConnection conn = new ExcelServicesConnection(connectionString)) {
  DataTable databaseSchema = conn.GetSchema("IndexColumns", new string[] {"Account"});
  foreach (DataRow row in databaseSchema.Rows) {


Dim connectionString As String = "Url=;;Password=password;File=Book1.xlsx;"

Using conn As New ExcelServicesConnection(connectionString)
  Dim databaseSchema As DataTable = conn.GetSchema("IndexColumns",  New String() {"Account"})
  For Each row As DataRow In databaseSchema.Rows
End Using

Columns Returned

The IndexColumns schema collection returns the following columns:

Column NameData TypeDescription
INDEX_CATALOGSystem.StringThe name of the database containing the index.
INDEX_SCHEMASystem.StringThe name of the schema containing the index.
TABLE_NAMESystem.StringThe name of the table containing the index.
INDEX_NAMESystem.StringThe name of the index.
COLUMN_NAMESystem.StringThe name of the column associated with the index.
ORDINAL_POSITIONSystem.Int32The sequence number of the column.
SORT_ORDERSystem.Int32Returns A for ascending and D for descending.

Copyright (c) 2020 CData Software, Inc. - All rights reserved.
Build 20.0.7587