당신이 BIGINT를 사용하려는 해달라고하면 당신은 PK로 테이블에 GUID (고유 식별자)를 사용할 수 있습니다. GUID의 최대 용량은 2^128입니다.
CREATE TABLE IntegratorQueue(
ID UNIQUEIDENTIFIER PRIMARY KEY DEFAULT NEWID(),--IDENTITY,
RefDetailId UNIQUEIDENTIFIER NOT NULL,
RefStartDate datetime
)
INT ID가 최대 값을 초과하는시기를 알아야 할 경우 삽입 전에 확인해야합니다.
INSERT INTO IntegratorQueue(RefDetailId, RefStartDate)
VALUES (NEWID(), GETUTCDATE())
-- INT capacity (-2,147,483,648) to (2,147,483,647)
IF 2147483647 - SCOPE_IDENTITY() < 500000
--... Do something... send an Email (xp_sendmail. http://msdn.microsoft.com/en-us/library/aa260697(v=sql.80).aspx)
-- Insert Notification records into an another table...
-- return with 1, or something else, like the end of your query instead of RETURN 0 RETURN 1 and check this... so on...
은 아마 DBCC CHECKIDENT (TABLENAME, RESEED, currentseed + 삽입) 그것은 또한 초과 될 수
예 DBCC CHECKIDENT는 ID 처리가 UI에서 사용되기 때문에 이것을 처리하는 데 더욱 익숙합니다. – dankyy1