• I'm like Jeff.

    I use CTE's to move subqueries to the top so I can treat them as the proper named derived tables that they are.

    I also use them when I need to use things like ROW_NUMBER in a where clause (you can't use it directly in a where clause but if it's in a CTE you can use it in the query that makes use of it).

    Of the hundreds of CTE's I've written, perhaps 1-2 of them make use of recursion.



    --Mark Tassin
    MCITP - SQL Server DBA
    Proud member of the Anti-RBAR alliance.
    For help with Performance click this link[/url]
    For tips on how to post your problems[/url]