Upper limit for autoincrement primary key in SQL Server

前端 未结 5 1458
南方客
南方客 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:49

    It depends on the datatype. If you use bigint, you're unlikely to ever overflow. Even a normal int gives you a couple billion rows. I've never overflowed, so I can't tell you what happens if you do.

提交回复
热议问题