For example, will SQL Server warn you or does it just die?
例如,SQL Server会警告你还是会死?
2 个解决方案
#1
18
SQL Server 2005 will throw the following error when you overflow the IDENTITY column.
当您溢出IDENTITY列时,SQL Server 2005将抛出以下错误。
Server: Msg 8115, Level 16, State 1, Line 1
Arithmetic overflow error converting IDENTITY to data type int.
Arithmetic overflow occurred.
Your identity column need not be constrained to an INT and indeed can be set to BIGINT if you suspect that INT will not be large enough.
您的标识列不必限制为INT,如果您怀疑INT不够大,实际上可以设置为BIGINT。
INT (32-bit signed) will go up to 2,147,483,647 and BIGINT (64-bit signed) to 9,223,372,036,854,775,807 (that's 9 quintillion, enough for 1.3 billion id's per person on the planet).
INT(32位签名)将升至2,147,483,647和BIGINT(64位签名)至9,223,372,036,854,775,807(即9个quintillion,足以满足地球上每人13亿的身份)。
#2
0
It would likely do both.
它可能会做到这两点。
#1
18
SQL Server 2005 will throw the following error when you overflow the IDENTITY column.
当您溢出IDENTITY列时,SQL Server 2005将抛出以下错误。
Server: Msg 8115, Level 16, State 1, Line 1
Arithmetic overflow error converting IDENTITY to data type int.
Arithmetic overflow occurred.
Your identity column need not be constrained to an INT and indeed can be set to BIGINT if you suspect that INT will not be large enough.
您的标识列不必限制为INT,如果您怀疑INT不够大,实际上可以设置为BIGINT。
INT (32-bit signed) will go up to 2,147,483,647 and BIGINT (64-bit signed) to 9,223,372,036,854,775,807 (that's 9 quintillion, enough for 1.3 billion id's per person on the planet).
INT(32位签名)将升至2,147,483,647和BIGINT(64位签名)至9,223,372,036,854,775,807(即9个quintillion,足以满足地球上每人13亿的身份)。
#2
0
It would likely do both.
它可能会做到这两点。