Q: Seed of primary key

  • Thread starter Thread starter Geoff Jones
  • Start date Start date
G

Geoff Jones

Hi

How do I set the starting value of an autoincrementing primary key?

Thanks

Geoff
 
1. Run the following insert query.

INSERT INTO YourTable (YourAutoNumberField)
Values (1000);

2. Open the table and delete that record you just inserted.
3. The next created record will have a value of 1001.

Obviously, you need to replace 1000 with the value that is one lower than
where you want it to start.
 
Back
Top