------------------------------- --- Table Valued Parameters --- ------------------------------- --- Create typed table variable CREATE TYPE mytab AS TABLE (id int); --Test DECLARE @t mytab; --- Use as a parameter (must be READONLY) CREATE PROC dbo.use_table As BEGIN DECLARE @tmp_tbl mytab --- Declare and initialize TABLE variable INSERT INTO @t VALUES (1), (2), (3) select * from @tmp_tbl END -------------------------- -- Execute EXEC dbo.use_table SELECT * FROM sys.table_types -- Table-Valued Parameters is a new parameter type From SQL SERVER 2008. -- Provides efficient way of passing the table type variable than using the temporary table or passing many parameters. -- It helps us in using complex business logic in single routine. -- They reduce Round Trips to the server making the performance better.