Bertiethedog
Programmer
My predecessor on this job liked auto incremental fields which I always understood were supposed to be a unique field to help with updates.
Unfortunatly the rest of the system is using them as a references so the value in the auto incremental field appears in other tables
Now I have a problem
My customer wants the ability to archive some records (easy) but then the ability to bring them back which at the moment would change the value in the auto incremental field.
I was wondering if I could change the field into a standard integer field and then write some code for the insert trigger. I could then disable this by creating a variable when I was appending in archived records so as not to change the value.
Are there any obvious pitfalls?
Is it possible to disable the autoincrement on the fly
Further info there are 162000 records in the table
Unfortunatly the rest of the system is using them as a references so the value in the auto incremental field appears in other tables
Now I have a problem
My customer wants the ability to archive some records (easy) but then the ability to bring them back which at the moment would change the value in the auto incremental field.
I was wondering if I could change the field into a standard integer field and then write some code for the insert trigger. I could then disable this by creating a variable when I was appending in archived records so as not to change the value.
Are there any obvious pitfalls?
Is it possible to disable the autoincrement on the fly
Further info there are 162000 records in the table