The Learner (12/13/2012)
Of course - makes total sense! Thanks for the tip.
I know it's an old post but you don't usually need to drop Temp Tables in a stored procedure. They usually clean themselves up.
If your Temp DB is consuming a 200GB drive, you have a larger problem with some seriously bad code. Look for code with DISTINCT in it which is a "cover" for bad code that has accidental Cross Joins in them. Some call thes "Many-to-Many" joins and they're usually the result of a poorly designed database or someone writing criteria for code without a full understanding of what the data actually contains.
--Jeff Moden
Change is inevitable... Change for the better is not.