• Microsoft documentation suggest that both derived tables and temporary table

    will first use memory cache if available.

    It then will use the temp database as needed in both cases depending on available cache.

    I think the advantages and disadvantages are more dependant on other issues

    such as indexing etc than the fact of using the temp database.

    This is a confusing and often misrepresented area of discussion.

    Jim