• Cadavre (10/16/2012)


    Lowell (10/16/2012)


    ok, adding WITH SCHEMABINDING to my scalar function cuts half a second off of my performance, so it goes to 7.5 seconds or so instead of over 8 seconds.

    DelimitedSplit8K already has the WITH SCHEMABINDING directive.

    The two of you are not producing the same result set in your test (not tested on the sample data provided by the OP).

    ========== Scalar Function ==========

    DETAILS_ID Column 1 Column 2 Column 3 Column 4

    ---------------------------------- ------------ ------------ ---------- ----------

    D221ACC59D214D9AA7480BDD0186B4F5 2012-04-06 2012-04-06 3 PL32145

    ========== DelimitedSplit8K Featuring Pivot ==========

    DETAILS_ID Col1 Col2 Col3 Col4

    ----------- ---------------------------------- ------------ --------------- ----------

    1 D221ACC59D214D9AA7480BDD0186B4F5 04/06/2012 04/06/2012 PL32145

    Cadavre - Can you provide the sample data you got this result with?

    When I run mine on the OP's sample data I get this:

    DETAILS_IDCol1Col2Col3Col4

    EA22749B180C41D09B4CC986D21C8F0211/28/200601/01/19001PL625245

    BTW. Changing the CONVERT format code to 103 should display the dates in dd/mm/yyyy as the OP needed (my mistake).


    My mantra: No loops! No CURSORs! No RBAR! Hoo-uh![/I]

    My thought question: Have you ever been told that your query runs too fast?

    My advice:
    INDEXing a poor-performing query is like putting sugar on cat food. Yeah, it probably tastes better but are you sure you want to eat it?
    The path of least resistance can be a slippery slope. Take care that fixing your fixes of fixes doesn't snowball and end up costing you more than fixing the root cause would have in the first place.

    Need to UNPIVOT? Why not CROSS APPLY VALUES instead?[/url]
    Since random numbers are too important to be left to chance, let's generate some![/url]
    Learn to understand recursive CTEs by example.[/url]
    [url url=http://www.sqlservercentral.com/articles/St