I need to insert about 6400000 rows a table with 2 columns
CREATE TABLE [DBName].[DBO].[BigList]
(
[All_ID] [int] identity(1,1) NOT NULL,
[Is_It_Occupied] [int] default(0) not null
)
I am using the following code today, which takes very long time about 100 minutes.
SET @NumberOfRecordsToInsert = 6400000;
WHILE (@NumberOfRecordsToInsert > 0)
BEGIN
INSERT [DBName].[DBO].[BigList] DEFAULT VALUES;
SET @NumberOfRecordsToInsert = @NumberOfRecordsToInsert - 1
END
Does anyone have a better way to do this?