sql server adds attributes to the created table (auto-increment)


When creating this table, set the ID to INT type, then set the Identity to yes, and the seed to increment by 1.
If this table has already been created, you can add a field called ID at the end, and then do the same as above, and then save It can be auto-incremented. (Be sure to set it up and save it)

             alter table student add id int identity(1,1)

 

After saving, a new column of id is added, the original primary key is deleted in the table design, the id is moved to the first column position, and the id is set as the primary key.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324612086&siteId=291194637