Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Add a New Indexed (duplicates allowed) Field

Status
Not open for further replies.

RSfromCO

Programmer
May 3, 2002
149
US
I would like to programatically add a new field that is indexed (duplicates allowed) to an MS-Access database. What is the cleanest SQL statement(s) for achieving this?

So far... I just for adding the field...
ALTER TABLE MyTable ADD COLUMN MyField TEXT(16);
 
To index the field
Code:
CREATE UNIQUE INDEX myIndex
ON myTable (myField)
The Create Index statement is documented here
 
Got it. I had to remove the UNIQUE parameter in order for it to allow duplicates in the indexed field.

Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top