In SQL SERVER I wrote some Table-Valued Functions to execute parameterized queries to the database and the returned results sets were used in t