Native Compiled Stored Procedures - Retrieve Result Set from an internal stored procedure (native compiled as well)

  • Hello,

    I have 2 native compiled stored procedures.
    The first one has a call for the second one, and the second one returns a Result Set. I want to retrieve the Result Set of the second one and continue using it in the first one.
    I cannot do this in any way with a temp,  variable or user defined table because of the limitations on the native compiles SPs:
    "The statement 'CREATE TABLE' is not supported with natively compiled modules."
    "The statement 'INSERT EXEC' is not supported with natively compiled modules."

    Any possible help or ideas would be greatly appreciated. Thank you!

  • I had the same situation when I created native compiled dropped procedures with SQL Server 2014.  Was hoping that with SQL Server 2016 it will be supported, but it seems that it still not supported.   I had to create a regular table and add a column that got unique value and was used as SessionID.  In the stored procedure I touched only the records that had the unique value that was assigned to this current activation of the procedure.  I also had to delete the record at the end of the procedure and had a weekly job that deleted old records in case that from some reason some of the records were not deleted.

    Adi

  • Thank you for your reply, I was thinking of doing something like this, but it's ugly (considering the business requirements aswell), so I thought maybe there would be another option. 

    Thanks again!

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

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