SQL Server Performance

How to insert multible records in a table at atime

Discussion in 'General Developer Questions' started by mpolaiah, Feb 6, 2009.

  1. mpolaiah New Member

    Hai All
    How to insert multible records in a table at atime
  2. Adriaan New Member

    Perhaps you are looking at BOL and only finding an example like:
    INSERT INTO table (col1, col2)
    VALUES (val1, val2)

    If the records are in Table1, and you want to insert them into Table2, then it's simple:
    INSERT INTO Table2 (col1, col2)
    SELECT t.colA, t.colB
    FROM Table1 t

    ... perhaps with some filtering criteria in a WHERE clause.
  3. FrankKalis Moderator

    Which version of SQL Server are you using?
  4. mpolaiah New Member

    sql server 2000
  5. FrankKalis Moderator

    Okay, in that case Adriaan's suggestion or SELECT INTO are the only ways to do this from table to table.
  6. ghemant Moderator

    You can use Union All to insert a multiple records

Share This Page