I have one stored procedure where I need to create temporary table/table type (I don't know exactly what to use). And I have one function which insert data according to matching case in the table (which is return type of function) of function. The scenario is like below.
stored_procedure
begin
@temp_table
my_function(@temp_table)
end
function my_function(@temp_table)
returns @result_table table
( value1 varchar(100),
value2 varchar(100),
... )
begin
case something -- > insert into @result_table
case something_1 -- > insert into @result_table
case something_2 -- > insert into @result_table
end
Note: I am working on SQL_SERVER 2005
The data of temporary table is needed in where clause (cross join in where condition) in various cases of function
Aucun commentaire:
Enregistrer un commentaire