I have a database that I often delete all values from and populate with new ones for test data. The scripts I run to populate the database often include tables with foreign key relations that force me to run part of the script, see what kind of keys are generated, and manually add values to tables based on these relations.
For example, if I'm inserting specific values into all of the fields except the primary key (id number) for a table, the id number starts at a random number, say 720, and if there are 30 insert statements, will increment by one each time and end at 749. If I then delete all the values from this table, then run the same script again to re-populate, the random primary key generated will start at 750.
I was wondering if there was a way to control the number (maybe an environmental variable?) that these id numbers begin at...anyone have any ideas?
For example, if I'm inserting specific values into all of the fields except the primary key (id number) for a table, the id number starts at a random number, say 720, and if there are 30 insert statements, will increment by one each time and end at 749. If I then delete all the values from this table, then run the same script again to re-populate, the random primary key generated will start at 750.
I was wondering if there was a way to control the number (maybe an environmental variable?) that these id numbers begin at...anyone have any ideas?