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 is Service Broker in SQL Server ?

What is the Difference Between VARCHAR and NVARCHAR in SQL Server ...

MS SQL Finding Which Tables a Column Name is In

Using Trim Function in MS SQL

What are the Events On Default Trace in SQL Server ?