Stored Procedure & User Table

  • I created the following sp as dbo then run it as cmss_user. The table gets created but then the select fails with ('aarobtmp does not exist'). cmss_user has db_owner. Can anyone help?

    CREATE PROCEDURE rob_tmp_1

    AS

    SELECT glt_urn,

    glt_code,

    glt_description

    INTO aarobtmp

    FROM ncm_general_list_type

    SELECT * FROM aarobtmp

    GO

  • You have to name your temp.table with prefix '# '

    like #aarobtmp:

    CREATE PROCEDURE rob_tmp_1

    AS

    SELECT glt_urn,

    glt_code,

    glt_description

    INTO #aarobtmp

    FROM ncm_general_list_type

    SELECT * FROM #aarobtmp

    GO

Viewing 2 posts - 1 through 1 (of 1 total)

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