• ...but just came to know that our application/framework does not support procedures of functions

    Just a thought...

    This might not help with the hierarchy situation but may help you get around your application's function limitation (which is terrible) in the future. You said the application limits you to views but can those views contain functions? You can use functions in a view. Using Jeff's suggestion: If you had a parameter table you could use a function like this:

    CREATE VIEW dbo.sneakyWayToUseAFunction

    AS

    SELECT iTVF.*

    FROM dbo.parameter

    CROSS APPLY dbo.<usefulFunction>(parameter.val) AS iTVF

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001