• e.dicesare (1/26/2015)


    looking at performances, I do always prefer to use temp tables instead of sub-queries

    It all depends on the query and how many subqueries there are.

    I've encountered cases where temp tables were slower because in your script you can create them only one at a time (because a script is serially executed), while a big query with lots of temp tables can read everything in parallel.

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP