SQL Server Performance

insert s/t in 2008

Discussion in 'SQL Server 2008 Questions [Archive Only - Closed]' started by SQLDBAS, Aug 2, 2007.

  1. SQLDBAS New Member

    When I was watching Merge slide show. I have observed
    You can insert records with the following statement
    INSERT INTO Production.UnitMeasure VALUES ((N'F2', N'Square Feet', GETDATE()),(N'Y2', N'Square Yards', GETDATE()));
    Any internal details which one performs better writign multiple inserts OR writing insert statement like above?
    another FUNNY stuff
    fter installing Katmai BOL C:program FilesMicrosoft SQL Server100License TermsLicense_BOL_en.txt
    If you open this file it shows
    MICROSOFT SQL SERVER 2005 BOOKS ONLINE :)

  2. satya Moderator

    Have you checked the execution plan for those 2 statements?
    It also depends upon the volume of the data including the indexes.
  3. SQLDBAS New Member

    Satya,
    I do not have 2008 on my machine. I can't test it. IF you guys find something intersting please let me know.
  4. Adriaan New Member

    Looks like you can have a series of VALUES clauses, separated with a comma.
    Not really new functionality - we can use SELECT with a values list, and we can use UNION:
    INSERT INTO Production.UnitMeasure
    SELECT N'F2', N'Square Feet', GETDATE()
    UNION SELECT N'Y2', N'Square Yards', GETDATE()
  5. thomas New Member

    I shouldn't think there would be much difference between the 2 different ways of constructing the insert statement.
  6. Adriaan New Member

    Agree - just pointing out that it's probably a new variation on existing syntax in Katmai, which can already be implemented with other existing syntax in current SQL versions.
  7. satya Moderator

    What I have suggested is performance and single insert statement (reduction in network traffic).
    I was also looking for such a notes within BOL, not sure it will be mentioned in SQL2008 BOL.

Share This Page