I am designin a new table which has an identity column with int type.The table supposed to have inserts most than 500.000 daily .So how can i avoid the problem of identity field exceeding max value?
my sample table create snippet is below
CREATE TABLE IntegratorQueue(
ID int PRIMARY KEY IDENTITY(0,1),--IDENTITY,
RefDetailId UNIQUEIDENTIFIER NOT NULL,
RefStartDate datetime
)
thanks
You can use GUID ( UNIQUEIDENTIFIER ) in your table as PK if you dont want to use BIGINT. The Max capacity of the GUID is 2^128.
But if you need to know when will your INT identity exceed the max value you should check before the insert.
Maybe the DBCC CHECKIDENT( tablename, RESEED, currentseed+inserted)