Create a join with the results of stored procedures

-2

Hello, I have two queries to return the result of two stored procedures

DECLARE @return_value int EXEC  @return_value = [dbo].[SP_TABLE_PRODUCTOS_ALMACEN] SELECT   'Return Value' = @return_value 

DECLARE @return_value1 int EXEC @return_value1 = [dbo].[SP_TABLE_CLIENTES] SELECT   'Return Value' = @return_value1

With the results I must create an inner join. Can someone help me?

    
asked by M. Bernal 08.03.2018 в 18:19
source

1 answer

1

If the procedures return a single result set, you could create variables of type table with the structure of the set returned by the procedure, and then work with those variables to make the join, for example:

DECLARE @Tabla TABLE (int number, ...)

INSERT INTO @Tabla EXEC [dbo]. [SP_TABLE_PRODUCTOS_ALMACEN]

    
answered by 08.03.2018 в 20:32