Identity Columns Can Have Gaps, and That’s Okay.
9 Comments
Say you’ve got a table with an identity column, something that’s supposed to start at 1 and go up to a bajillion: Transact-SQL DROP TABLE IF EXISTS dbo.Orders; CREATE TABLE dbo.Orders (Id INT IDENTITY(1,1) PRIMARY KEY CLUSTERED, OrderDate DATETIME2, CustomerName NVARCHAR(50)); GO /* Put a starter row in there: */ INSERT INTO dbo.Orders (OrderDate, CustomerName)…
Read More

















