Can We Pass Temp Table as Parameter to Stored Procedure
A Temp Table of User Defined Table Type Has to Be Created of the Same Schema as That of the Table Valued Parameter and Then It Is Passed as Parameter to the...
A TEMP Table of User Defined Table Type has to be created of the same schema as that of the Table Valued parameter and then it is passed as Parameter to the Stored Procedure in SQL Server.
How do you pass a temp table to a stored procedure as parameter?
First, you have to define the user defined type for the table variable to be used by the stored procedure. The stored proc can then be called with a table variable directly from SQL. Note: If you are using . NET, then you can pass the SQL parameter from a DataTable type matching the user defined type.
Must Read
Can we use table variable in stored procedure?
Table Variables Can Be Returned From a SQL Server Function. While table variables can be created in stored procedures, their use is restricted to within the stored procedure declaring the variable.