blog.philipsymons.com
Enforcing the Table Type Returned by a Sql Function
In Sql Server it is possible to ensure that a function will only return a given user-defined table type, although it does involve some slightly unorthodox coding