0

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.

Community
  • 1
  • 1
JAT
  • 317
  • 1
  • 2
  • 12

1 Answers1

1

I doubt you would be able to achieve nested insert exec References :
http://social.msdn.microsoft.com/forums/en-US/transactsql/thread/e66c9e71-4424-4cf3-920c-6725ffc40162/
But I guess this might help you
http://www.sqlservercentral.com/Forums/Topic13595-8-1.aspx#bm68301

NG.
  • 5,695
  • 2
  • 19
  • 30