What happen in SQL 2005 when it run out of number for an autonumber column?

后端 未结 6 602
囚心锁ツ
囚心锁ツ 2021-02-08 12:07

What happen when SQL Server 2005 happen to reach the maximum for an IDENTITY column? Does it start from the beginning and start refilling the gap?

What is the behavior

6条回答
  •  不知归路
    2021-02-08 12:59

    It will not fill in the gaps. Instead inserts will fail until you change the definition of the column to either drop the identity and find some other way of filling in the gaps or increase the size (go from int to bigint) or change the type of the data (from int to decimal) so that more identity values are available.

提交回复
热议问题