A developer asked me to look at why a stored proc was leading to timeouts on the app. I copied the sproc into QA, stripped out the 'create procedure' stuff and ran the code. It runs but takes over a minute to complete (no wonder considering the way it is written). Anyway, I want to look at the execution plan but as soon as I do this, I get the above error. I can see the temp table in the code and I can't see anything wrong with the way it is used and, in any case, the code works. Can anyone explain what causes this problem and what can be done to remove the problem so I can see the execution plan?