Tuesday, July 17, 2007

T-SQL Temporary Tables vs. Table variables

Lakeside SQL - Articles — Temporary Tables vs. Table Variabl...

1. There is no universal rule of when and where to use temporary tables or table variables. Try them both and experiment.

2. In your tests, verify both sides of the spectrum – small amount/number of records and the huge data sets.

3. Be careful with migrating to SQL 2005 when you use complicated logic in your stored procedures. The same code can run 10-100 times slower on SQL server 2005!

No comments: