• Very nice article and very useful query.

    Just out of curiosity, why did you decide to make it a procedure instead of a view?

    Naturally you would lose that order by, but since you may wish to see it ordered by other things such as User or Status anyway it seems the view would be more flexible.

    ---
    Timothy A Wiseman
    SQL Blog: http://timothyawiseman.wordpress.com/