How to return temporary table from stored procedure

前端 未结 6 1603
陌清茗
陌清茗 2020-12-15 07:31
CREATE PROCEDURE [test].[proc]
@ConfiguredContentId int,
@NumberOfGames int
AS
BEGIN
 SET NOCOUNT ON
 RETURN 
 @WunNumbers TABLE (WinNumb int)

    INSERT INTO @WunN         


        
6条回答
  •  粉色の甜心
    2020-12-15 08:22

    YES YOU CAN.

    In your stored procedure, you fill the table @tbRetour.

    At the very end of your stored procedure, you write:

    SELECT * FROM @tbRetour 
    

    To execute the stored procedure, you write:

    USE [...]
    GO
    
    DECLARE @return_value int
    
    EXEC @return_value = [dbo].[getEnregistrementWithDetails]
    @id_enregistrement_entete = '(guid)'
    
    GO
    

提交回复
热议问题