• If you can show the code using the TVF and the code for the TVF would be helpful as well as the actual execution plans for both a fast and slow run of the query. As this appears to be on SQL Server 2005, please save and post the plans as .sqlplan files.