Possible Duplicate:
Errors: “INSERT EXEC statement cannot be nested.” and “Cannot use the ROLLBACK statement within an INSERT-EXEC statement.” How to solve this?
We have a sproc in production which returns a selection. This selection is populated by an INSERT INTO to a temp table, calling a sproc.
So now we now need to produce another sproc, which will be using the data returned by sproc_1. The problem is that the new sproc also contains a temp table, which is populated by calling sproc_1.
Obviously we get the SQL error complaining about nested insert-exec.
Any ideas how to get past this? We have spent a day researching the problem, not finding a working solution.