Home | Feedback | Login

SQL Generate Incremental Numbers

DROP TABLE [dbo].[SerialNo]
SELECT TOP 10000000 IDENTITY(int,1,1) AS Number
    INTO  [dbo].[SerialNo]
    FROM sys.objects s1
    CROSS JOIN sys.objects s2
ALTER TABLE [dbo].[SerialNo] ADD CONSTRAINT 
PK_NumbersTest PRIMARY KEY CLUSTERED (Number)

SELECT COUNT(*) FROM  [dbo].[SerialNo]

It creates a table with incremented numbers.