We have a SP which is running for ever, where as when it is run as script it takes just couple of minutes to complete. I tried couple of things: - I tried to flush the plan for that procedure and run again but didn't run. - I tried to run the SP with recompile but didn't run. What can be the possible reasons that it runs as plain script and not as SP even after flushing the cache for that SP?