In this article from chapter 2 of SQL Server DMVs in Action, author Ian Stirk discusses a quick method of creating temporary tables, which is needed when we want to loop over all databases on a server, extracting the results as we go.

Looping over Databases on a Server (PDF)