Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2004
    Location
    Long Island
    Posts
    696

    Unanswered: Insert select vs. Insert Values

    Performance-wise, is there a difference between the two:

    insert into tablename
    (col1, col2, col3, col4, col5)
    select
    @col1, @col2, @col3, @col4, @col5

    vs.

    insert into tablename
    (col1, col2, col3, col4, col5)
    values
    (@col1, @col2, @col3, @col4, @col5)

  2. #2
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    Yes, but for one row the difference is too small to measure.

    -PatP

  3. #3
    Join Date
    Jun 2004
    Location
    Long Island
    Posts
    696
    A developer here uses the first method to insert rows, probably 50000-60000 rows per night. They are always single row inserts, I've always seen the latter used for a single row insert, the first for multi row from another object.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •