What are Table Valued Parameters ?

Table-Valued Parameter is a new feature introduced in SQL SERVER. In earlier versions of SQL SERVER, it is not possible to pass a table variable in a stored procedure as a parameter, but now in SQL SERVER, we can use Table-Valued Parameter to send multiple rows of data to a stored procedure or a function without creating a temporary table or passing so many parameters.

Table-valued parameters are declared using userdefined table types. To use Table-Valued Parameters we need to follow the steps shown below...

  • Create a table type and define the table structure.
  • Declare a stored procedure that has a parameter of table type.
  • Declare a table type variable and reference the table type.
  • Using the INSERT statement and occupy the variable.
  • We can now pass the variable to the procedure.


You May Interest

What are the System Data Collection Sets Predefined Inside SQL Se ...

What Have INCLUDED Columns With SQL Server Indexes ?

What is an Online Rebuilding of Indexes in SQL Server ?

Getting List of MS SQL User-Created Tables

What is TABLESAMPLE in SQL Server ?