[Original] Initial Value Setting and resetting number of access automatic numbers

Source: Internet
Author: User

Today, I suddenly needed to set the initial value and step size for columns with automatic numbers in the Access database, but I found that no direct visual operation was performed. However, I think that since it can use SQL statements, it can be set with SQL statements. I tried it and it was OK.

Modify using SQL:

<! -- Modify the start value, step, and initialization ID of a table -->

The method is as follows:

Alter table tablename

Alter column ID counter (100, 5)

Where: tablename is the name of the table to be modified, ID is the auto-numbered column, 100 is the initial value, and 5 is the step size.

Similarly: If you want to reset the number, you only need to change 100 to 1.

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.