Aug
15
INF: Frequently Asked Questions - SQL Server 2000 - Table Variables
I was asked a good interview question awhile back, about the different ways to define a temporary table. To be honest, I thought I nailed my answer, but the interviewer corrected me. A few weeks later, I tested his corrections to see if they were true, and they were not. That said, I never got to the bottom of the exact differences between table variables and temp tables, until now.
Learning this also led me to apply a couple of useful checks not supported by current TSQL static code analysis tools, such as SQL Enlight.