What happens when a column value in a table in MSSQL reaches a maximum and a solution?

My table

---------------------
id(int-PK-AI) | name
---------------------
1             | a
2             | b
...           |

max           | x
???           | ...

What happens when the value of the column identifier (auto-increment of the primary key) in a table in MSSQL is greater than the maximum value? error or what happens? and what is the solution to prevent?

+4
source share
2 answers

when someone tries to execute INSERT, and the identifier that will be generated overflows the data type of the column, they will receive an error message (arithmetic overflow, I believe) and INSERTwill fail.

, , . 64- DECIMAL .

+1

, . . bigint id.

+1

All Articles