I have two fairly large and complex stored procedures. I want to call a second stored procedure from the first stored procedure. For example:
-- stored_procedure_one
select tb1.col1, tb1.col2, sp1.col3, sp1.col4
from table1 tb1
inner join stored_procedure_two sp1 on sp1.col1 = tbl1.col1
Is something similar possible with SQL as the above script gives me an invalid object error message.
Using a temp table is not good in this example, because if I did that, it would take an hour just to fill the temp table with all the data from the second stored procedure. I only want the stored procedure to return the needed data.