Home Forums SQL Server 2008 T-SQL (SS2K8) Doing something like an Excel FillDown function in SQL looking for suggestions??? RE: Doing something like an Excel FillDown function in SQL looking for suggestions???

  • Want a cool sig (11/13/2012)


    Wow Jeff that is wicked fast... thanks a lot... the time for returning 2600 rows really shows how much faster your method is...

    Jeff's wicked fast script

    SQL Server Execution Times:

    CPU time = 563 ms, elapsed time = 682 ms.

    My wicked slow script

    SQL Server Execution Times:

    CPU time = 25500 ms, elapsed time = 25696 ms.

    Ugh! I appreciate the compliment but more than 1/2 a second to process just 2600 rows is pretty bad for me. The right kind of index might help it, though.

    I say it's slow because a "Quirky Update" would do such a thing to a million rows in about 2 or 3 seconds. If you have a large nnumber of rows, let me know and we'll see what we can put together for you.

    --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)