• Or you could create the temp table outside the proc, before calling the proc.

    CREATE PROC TEST3

    AS

    -- Proc refers to a temp table that must exist prior to calling.

    INSERT INTO #TEST3

    SELECT 'InProcTest', 'InProcRow';

    GO

    -- Create the temp table ahead of time calling the proc

    SELECT 'Original Test' AS Col1, 'Original Row' AS Col2

    INTO #TEST3 ;

    -- run the proc

    EXEC TEST3;

    -- Check results

    SELECT * FROM #TEST3;