I have a big user defined table type variable that has 129 columns. I will store around 2000-3000 records in this table variable at a time and pass it to various stored procedures and functions to get additional data and make modifications. These additional data and new modifications will then be stored in a new table variable of the same type and returned to the source stored procedure via an OUTPUT
parameter. (This is because a table type parameter can only be passed as READONLY
.)
This is my pseudo-code:
SP1
@tmp tableType
{
INSERT @tmp EXEC
SP2 (@tmp)
INSERT @tmp EXEC
SP3 (@tmp)
}
Should I use a @table_variable
or #temp_table
?