Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to turn autoincrement off briefly in free table
Message
From
28/09/2005 18:09:41
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 8
Miscellaneous
Thread ID:
01054246
Message ID:
01054258
Views:
15
>>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
Previous
Reply
Map
View

Click here to load this message in the networking platform