I don't agree with the suggested split points.
IMHO, Megan's comment is the more completed one and should be the one marked as Best Solution and Big's and mine's comment should be marked as Assisted Solution. So my suggestion is:
I don't care about the points. Resolve it any way that is satisfactory to the others. For abandoned questions like this where I was the only respondent, I just delete them.
Big Monty
i dont care about the points either, however I don't necessarily believe Megans answer is the "best" one, as I think simply creating a stored procedure and putting all of the logic there is the simplist, most efficient way to work with temp tables, as they will be available to you throughout the life of the stored procedure. In all of my 15+ years working in classic asp, I've never used, or come across any reference to, sp_executesql.
Like I said, I dont care how the points are rewarded, I was just trying choose, what I thought was, the best answer.
IMHO, Megan's comment is the more completed one and should be the one marked as Best Solution and Big's and mine's comment should be marked as Assisted Solution. So my suggestion is: