Upper limit for autoincrement primary key in SQL Server

前端 未结 5 1457
南方客
南方客 2020-12-24 07:10

What is the upper limit for an autoincrement primary key in SQL Server? What happens when an SQL Server autoincrement primary key reaches its upper limit?

5条回答
  •  别那么骄傲
    2020-12-24 07:35

    Data types descriptions:

    BIGINT    Integer data from -2^63 through 2^63 - 1
    
    INT       Integer data from -2^31 through 2^31 - 1
    
    SMALLINT  Integer data from -2^15 through 2^15 - 1
    
    TINYINT   Integer data from 0     through 255
    

    When you reach the upper limit the autoincrement goes to the lower limit.

提交回复
热议问题