• Coderx7 (7/24/2014)


    Hello Everyone,

    About two months ago me and two of my friends tried to see for ourselves whether Oracle is faster than SQL Server or vice versa, and or if they are on par most of the time,

    We didn't have a clue how to go about it, so we decided to create a a stored procedure to insert some rows in a loop ( around 1000,000 ).

    In oracle (11g i guess ) it took 1:57 minutes and sqlserver 2012 took ~3 minutes.

    we had an auto incrementing Id, and a field representing name for example.

    I cant believe SQL Server is this slow compared to oracle.What are we missing here?

    This is not all, I have read in StackOverflow (i guess) that SQL Server is transaction based internally as well, so if in the middle of something we cancel our operation, the inserted rows or updated columns must be deleted or get reverted back.

    To test this, we actually tried to run the stored procedures mentioned above, and cancelling its execution after couple of seconds

    Oracle indeed reverted back the changes, but SQL Server 2012 didn't do that at all, it just cancelled the loop half way and the data that were inserted in to the table, remained there, weren't erased !!

    So Why is SQLServer acting this weird? what are we doing wrong? Apparently SQLServer is being used on highly data intensive servers world wide as well , But such a low performance compared to oracle according to our simplistic sample test is not just right!

    I would be thankful if anyone could help me get what the problem is here.

    Thanks in advance

    Post both snippets of code and let's have a look.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)