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 CHECKPOINT Process in the SQL Server ?

What is SQL Injection in SQL Server ?

What is The Difference Between The Index Seek and Index Scan in S ...

How is Deadlock Different From a Blocking Situation in SQL Server ...

MS SQL List of Records in All Tables