Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to turn autoincrement off briefly in free table
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 8
Divers
Thread ID:
01054246
Message ID:
01054258
Vues:
16
>>Two free tables have similar but not identical structure, with one field that autoincrements present in both. One table is empty and needs to receive data from the other table bit retain old value of field that autoincrements.
>>
>>What is the simplest way to turn autoincrement off momentarily and then back on?
>>
>>Thank you.
>>
>>Alex
>
>
>alter table (lcTable) alter column (your autoinc field) I && removes autoinc
>
>later on
>
>alter table (lcTable) alter column (your autoinc field) I autoinc && adds autoinc
>
>
>You can also include NextValue (lnNewValue) and STEP (lnNewStep) when turning on the autoinc, something like,: I autoinc nextvalue (lnNewValue) step (lnNewStep)
>
>
>(You must have the table opened in excluive mode)

Thank you Hugo. Since I am modifying a generic structure update routine to consider autoincrementing fields I'll have to do AFILES() for both tables and compare. I was hoping there was something like SET AUTOINC OFF :) That would have been too easy. I believe there is something like that is SQL Server.

Thanks again.

Alex
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform