Temp Tables (#) Vs. Table Variables (@): which one to use, which solution is the fastest?
Hi Guys, Welcome back! Some time ago I was asked what the differences were between the temporary tables and in-memory table variables . I wrote this post with the intent to clarify! ...I hope I have succeeded. Today I wanted to present a comparison between temporary tables (#) and variables of type table (@) . We will analyze in detail the differences between these two types of tables to understand when it is better to use one type rather than another . But not only that: You will have the opportunity to see how to read the transaction log and use the RML utilities to generate the parallel workload necessary for our analysis. We use the term "temporary tables" because it often happens in our calculations that we need an "intermediate" table on which to place data. Due to the fact that our tables are "temporary" after use we will not need to delete them: this is certainly a great convenience. "Temp Tables" (#) Vs. "Table Variables...