Last tip, T-SQL Tip 12, was on temp tables. Another object that will allow you to hold onto and reuse results is a table variable. These are created with an @ symbol and are created in a declare statement, @ThisIsAVariable. They only persist as long as the batch they are declared in. If you store the results of a query in a table variable, you can use that variable for further queries in your batch. We talked about execution plans in T-SQL Tip 8, and these objects are unique in some very specific limitation on those plans. SQL Server does a poor job at guessing how much data is in them, with old enough versions assuming just 1 row. For large enough table variables, this can make queries run real bad. Despite that they are great for passing results into stored procedures, even if you then dump to a temp table inside the SP.