Wiki Home

Add Index


Namespace: WIN_COM_API
I have a table that is populated with approx. 5000 rows.
I wish to add a unique index and have the index populated ascending numerically.

What is the easiest way to accomplish?


INDEX ON FooField UNIQUE [Ascending]-- Steven Black

USE aTable EXCLUSIVE
SELECT *, RECNO( ) as RecID FROM aTable INTO CURSOR crsTable
ALTER TABLE aTable ADD COLUMN RecID I(4) PRIMARY KEY RecID TAG RecID
DELETE ALL
PACK
APPEND FORM DBF( "crsTable" )

This should also give you a unique index. If you have a primary key, you may use CANDIDATE. -- Pj Fernandez
Category Questions Closed