• This is long overdue.  I've had this functionality in Oracle for the past ten years (since Oracle 8.0)!  When Microsoft introduced the table variable, they never finished the job.

    I also noticed that the persistent table definition via the CREATE TYPE statement is the same as Oracle's.

    I recently needed this functionality as I had a small 2-dimensional array (table variable, NOT a #temp table) that needed to be processed by other logic which would then return a table result.  This 2-dimensional array was used in several procedures.  In the interest of good OO programming, a UDF taking in a table-valued parameter and returning a table was the obvious choice.  Sadly, I couldn't do it in SQL Server 2005.  To use persistent (#) temp tables and/or transform it into XML and then shred it again inside the function was out of the question due to coding and performance overhead.

    So I coded the logic in-line within the procedures (performance being the governing factor) with suitable coding comments to refactor the code when SQL Server 2008 is deployed (Q3/Q4 2008).


    [font="Arial Narrow"](PHB) I think we should build an SQL database. (Dilbert) What color do you want that database? (PHB) I think mauve has the most RAM.[/font]