0

I have an application which inserts large amount of data in Access database. So to speed up the things i have set Indexed property to No.

So at the end of insertion i need to set the index to the column of the one of the table to Indexed (Duplicates OK) through C#.

I tried:

string addIndex = "CREATE INDEX columnName ON table(columnName) WITH IGNORE NULL";
OleDbCommand cmd = new OleDbCommand(addIndex, conn);
cmd.ExecuteNonQuery();

but it didn't work.

Help would be appreciated.

4

1 回答 1

2

Try not using the column name as the index name:

CREATE INDEX idx_columnName ON table(columnName) WITH IGNORE NULL

Access may not let you name an index the same as an existing column (or table)

于 2013-01-31T22:50:42.610 回答