How to pass a temp table as a parameter into a separate stored procedure

后端 未结 3 395
青春惊慌失措
青春惊慌失措 2020-12-29 02:21

I have a stored procedure that takes an input parameter @CategoryKeys varchar, and parses its contents into a temp table, #CategoryKeys.

         


        
3条回答
  •  半阙折子戏
    2020-12-29 02:58

    Stored proc that uses temp table

    CREATE OR ALTER Procedure Engine.TestProcTempTable
    AS
    BEGIN
      --DROP TABLE IF EXISTS #TestProcTempTable ;
      SELECT * from #TestProcTempTable;
    END
    

    Create put data in to temp table which will be used by SP

    DROP TABLE IF EXISTS #TestProcTempTable ;
    select * into #TestProcTempTable from ;
    execute Engine.TestProcTempTable
    

提交回复
热议问题