>I have a project where I have about 80 tables. They all have the field Numero as Integer. This field serves for the primary key. I have a Table.dbf which contains all the names of those 80 tables as well as a field Table.LastID which holds the current last primary key of each of those tables. I need to scan Table.dbf and apply the following process for each of those 80 tables:
>
>1. Open the table in exclusive use
>2. Alter the structure of Numero field to be Auto Increment
>3. Adjust the table auto increment functionality so it would start from the value of Table.LastID
>
>It is basically point 3 which causes me a problem. By default, changing the structure to Auto Increment makes the current primary key to be 0. I need it to be set to Table.LastID.
ALTER TABLE TableName1 ADD | ALTER [COLUMN] FieldName1
FieldType [( nFieldWidth [, nPrecision])] [NULL | NOT NULL] [CHECK lExpression1 [ERROR cMessageText1]]
[AUTOINC
[NEXTVALUE NextValue [STEP StepValue]]]What seems to be the problem?
If it's not broken, fix it until it is.
My Blog