Possible Duplicate:
What happens to the primary key Id? when it goes over the limit?
what will append if have an SQL server table with an identity column (says an int) that reaches the maximal capacity of the int ?
Go back to the beginning ?
Assume that the lines grow 100 by 100. Each time I insert 100 new lines, I delete the 100 old ones.
Thanks for your answer Best regards
Each time a row is inserted into the table, the identity column is assigned the next highest value. If the identity reaches the maximum value, inserts will fail.
SQL Server internally manages the values of Identity Columns and does not generate any Duplicate Values.
The maximum value that you can insert into an IDENTITY column is 10 precision - 1.
The maximum value will be the largest value that a type can support. Suppose you are using an Int type as IDENTITY, in 32 bit system the max number will be 2^32-1. When this number is reached, the next attempt to insert a value will result in a overflow error and will fail.
You'll get an arithmetic overflow error when you exceed the max int value.
Try it:
DECLARE @t TABLE (
id INT IDENTITY (2147483647,1),
name VARCHAR(100)
)
INSERT INTO @t (name) VALUES ('Joe')
INSERT INTO @t (name) VALUES ('Tim')
It won't allow you to insert more rows.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With