>>How does your function sample relate to the question?
>
>The sample was a Table Function that I wrote for another solution. It is intended to be a sample of passing a parameter to a function that can then be used on the WHERE clause.
I see. In the original question he asked how to pass table name dynamically. In this case the only solution is dynamic SQL and so using UDF is not possible.
If it's not broken, fix it until it is.
My Blog