title: SQL Server inserting huge number of rows to a table with default values and identity column in it
body: <p>I need to insert about 6400000 rows a table with 2 columns </p>
  
  <pre><code>CREATE TABLE [DBName].[DBO].[BigList] 
  (
  [All_ID] [int] identity(1,1) NOT NULL, 
  [Is_It_Occupied] [int] default(0) not null 
  )
  </code></pre>
  
  <p>I am using the following code today, which takes very long time about 100 minutes.</p>
  
  <pre><code>    SET @NumberOfRecordsToInsert = 6400000;
  WHILE (@NumberOfRecordsToInsert &gt; 0)
  BEGIN
      INSERT [DBName].[DBO].[BigList] DEFAULT VALUES;
      SET @NumberOfRecordsToInsert = @NumberOfRecordsToInsert - 1
  END
  </code></pre>
  
  <p>Does anyone have a better way to do this?</p>