The disadvantage of your solution is that you have to have a aclumn named "deed_name" within each table you want to apply that dynamic query to.
Therefore, I decided to use a variable for the OVER clause, too.
It's also easier to control the order of the output values. Example: You could easily run it with
@V_ORDER_BY_QUERY = 'ORDER BY deed_name DESC '
without any changes to the dynamic part.