-dynamic- function to convert several rows of a table to a csv list

  • Of course your CLR function is going to beat the T-SQL function... you used RBAR on steriods... you need to test against a correctly written T-SQL function for this to be a valid test. I'll provide two different UDF's for addition testing, if you'd like, but using a While loop against a CLR isn't a real test of if a CLR is faster or not.

    --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)
    Intro to Tally Tables and Functions

  • Hi all,

    thanks for all the replies...

    Best Regards

    Smerg

  • I was struggling with how to tackle this type of problem in T-SQL until I came across your sample code Jeff.

    What can I say?

    A bloody marvelous and timeless piece of T-SQL. It does exactly what I want it to do and I've learned something new in the process.

    Thank you.

Viewing 3 posts - 16 through 17 (of 17 total)

You must be logged in to reply to this topic. Login to reply