So basically I have this relatively long stored procedure. The basic execution flow is that it SELECTS INTO some data into temp tables declared with he #
SELECTS INTO
#
I'd also look into parameter sniffing. Could be the proc needs to handle the parameters slighlty differently.