Create a temp table in SP from another SP?

  • Can you create a temp table in a stored procedure from another stored procedure that returns a recordset?

  • Yes.  That's typically how one deals with a set returned from a called proc.



    --Jonathan

  • Probably a dumb question, but how do you call another SP from within a SP into a temp table that can be used elsewhere in the calling SP?

  • CREATE TABLE #Temp(

    Col1 int,

    Col2 int)

    INSERT #Temp

    EXEC p_Test 'YourParam'

    Put all the DDL at the beginning of your calling proc to prevent excessive recompiles.



    --Jonathan

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply