An Azure relational database service.
A failed, canceled, or rolled-back large insert—potentially from ETL batching, parallel execution, or retry logic—is the leading explanation because Azure SQL Database consumes generated identity values even when the statement or transaction does not commit.
IDENTITY does not guarantee consecutive values, and consumed values are never reused after a failed statement or rollback.^1^ A closely matching Microsoft Q&A case identifies a failed or rolled-back bulk/batch insert, retry, or background load as the realistic cause of a massive jump.^2^
The successful status of both ETL runs does not rule this out. An intermediate statement could have failed and been retried, or its error could have been caught inside the stored procedure or application. With failovers and restarts already excluded, ordinary identity-cache loss is not a persuasive explanation for a 1.72-billion jump.
Confirm the current state and capacity
Run this with the actual schema and table names:
SELECT
OBJECT_SCHEMA_NAME(ic.object_id) AS schema_name,
OBJECT_NAME(ic.object_id) AS table_name,
ic.name AS identity_column,
CONVERT(bigint, ic.last_value) AS last_generated,
2147483647 - CONVERT(bigint, ic.last_value) AS values_remaining,
CAST(100.0 * CONVERT(bigint, ic.last_value) / 2147483647
AS decimal(6,2)) AS percent_consumed
FROM sys.identity_columns AS ic
WHERE ic.object_id = OBJECT_ID(N'dbo.YourTable');
DBCC CHECKIDENT (N'dbo.YourTable', NORESEED);
sys.identity_columns.last_value is the last generated identity value, while DBCC CHECKIDENT(..., NORESEED) reports both the current identity and maximum stored column value without changing either.^3^^4^
At 1,793,678,945, approximately 353,804,702 positive INT values remain. The maximum INT value is 2,147,483,647; BIGINT extends to 9,223,372,036,854,775,807.^5^
Investigate the seven-minute interval
- Inspect ETL and application logs for the exact interval, including:
- canceled commands and command timeouts;
- deadlock or constraint errors;
- retry counts;
- unexpectedly large source-row estimates;
- parallel workers or duplicate pipeline execution;
-
TRY/CATCHblocks that log or suppress an error and continue.
- Check Query Store, if it was already collecting data then. Filter executions to the interval and inspect statements targeting this table or its loading procedure. In
sys.query_store_runtime_stats, execution type3means client-aborted and4means exception-aborted.^6^ - Review Azure SQL audit records, if auditing was enabled and configured to capture the relevant batches. Auditing can retain and analyze database activity in Azure Storage, Log Analytics, or Event Hubs.^7^ Be aware that auditing prioritizes database availability and might omit selected events during very high activity or network load.
If neither application telemetry, Query Store, nor auditing retained the interval, the exact originating session might no longer be provable. Configure auditing and detailed ETL attempt/row-count logging now so another occurrence captures the caller, statement, attempt number, and transaction result.
Address the exhaustion risk
Schedule migration of the identity column and every referencing foreign-key column from INT to BIGINT. Microsoft documents that an identity column’s data type can be changed when the new type is compatible, and BIGINT is intended for values exceeding the INT range.^1^
The core operation is:
ALTER TABLE dbo.YourTable
ALTER COLUMN Id BIGINT NOT NULL;
Test the complete dependency-aware migration first: foreign keys, referencing columns, indexes, stored-procedure parameters, ETL mappings, and application models must also accept BIGINT.
Do not reseed downward as an immediate fix. On a nonempty table, reseeding below existing values can later produce primary-key/unique-key violations or duplicate identities.^4^
References
- CREATE TABLE (Transact-SQL) IDENTITY (Property)
- Identity Column jumps massively from 168712 to 9999993 - Microsoft Q&A
- sys.identity_columns (Transact-SQL)
- DBCC CHECKIDENT (Transact-SQL)
- int, bigint, smallint, and tinyint (Transact-SQL)
- sys.query_store_runtime_stats (Transact-SQL)
- Auditing for Azure SQL Database