• ChrisM@Work (8/30/2012)


    dwain.c (8/29/2012)


    RBarryYoung (8/29/2012)


    Unless the queries all strictly follow the same very simple format, this is going to fall somewhere between "Impossible" and "Incredibly Hard" to do in SQL.

    If the queries are all truly valid (i.e., actually compilable, with tables and columns that actually exist in the database), then there is a way to do it the is merely "Very Difficult, Slow and Kludgy".

    So Barry - what do you think of my suggestion?

    Poll (select all that apply):

    1. Impossible

    2. Incredibly hard

    3. Very Difficult

    4. Slow

    5. Kludgy

    6. Clever

    😀

    4. Slow and 7. Tedious, going through all the queries adding "dbo." before each table name 😛 😀

    Ouch! Tough audience.

    Better slow and tedius I guess than Impossible!


    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