SQL Server Performance

increase the speed of insert statment

Discussion in 'SQL Server 2005 Performance Tuning for Hardware' started by mffm, Mar 2, 2008.

  1. mffm New Member

    Hi all
    i'm using sqlserver 2005
    this statment take 1:30 min to execute
    ****insert into temotable (select key from table1)
    if i used a select statment alone it takes 4 sec
    but with insert statment it take 1:30min
    by the way i put indexes on the table1
    plz how i can increase the speed of insert statment.

    thanks in advance
  2. techbabu303 New Member

    The number rows insertes is large , break them into batches setting the ROW COUNT before the query and then insert.
    Could you please specify the total number of rows in table1 and datatypes in table 1.
    Also tell us type of index you have created on which column data type ?
    Cheers
    Sat
  3. mffm New Member

    the number of rows is more than 4,000,000 records
    the data type char(8)
    in table one the column primekey is primarykey
    thanks
  4. satya Moderator

    Why not insert using BCP or BULK INSERT?
  5. mffm New Member

    i don't know what are that BCP and BULK INSERT?
    plz what do u mean?
    thanks
  6. bertcord New Member

    SELECT key INTO temotable from table1
  7. satya Moderator

Share This Page