• anil.varghese (4/2/2014) (From PM)


    Luis

    Thanks for your assistance. I believe I do understand what you are doing. This is new to me, so if there is some documentation on what you did, I would love to read up on it. It's a recursive query I believe where you created this grouper column to Identify when a title change occurred. The update of a SET is new to me though.

    ACV

    It's not a recursive query, that's a different concept.

    To read about this, you could look for nested or cascade CTE. Books On Line (the help that comes with SQL Server) has explanations and examples http://msdn.microsoft.com/en-us/library/ms175972.aspx

    Updating a CTE is basically as updating a view. You can find documentation here: http://technet.microsoft.com/en-us/library/ms180800.aspx

    The logic behind the grouper column is explained in this article: http://www.sqlservercentral.com/articles/T-SQL/71550/. The only difference is the time period (the article uses days and your query uses years).

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2