Read our blogs, tips and tutorials
Try our exercises or test your skills
Watch our tutorial videos or shorts
Take a self-paced course
Read our recent newsletters
License our courseware
Book expert consultancy
Buy our publications
Get help in using our site
551 attributed reviews in the last 3 years
Refreshingly small course sizes
Outstandingly good courseware
Whizzy online classrooms
Wise Owl trainers only (no freelancers)
Almost no cancellations
We have genuine integrity
We invoice after training
Review 30+ years of Wise Owl
View our top 100 clients
Search our website
We also send out useful tips in a monthly email newsletter ...
Speed comparison of temporary tables against table variables Part one of a five-part series of blogs |
---|
When you are programming in SQL, you often have the choice of using table variables or temporary tables. This blog considers whether one method is substantially quicker than the other (spoiler alert: not really).
|
This blog assumes that you already know what temporary tables and table variables are (if you don't, you could do worse than read our online tutorials (here) or watch our video tutorials (here or here) on the subject - or go on our advanced SQL course).
Here are the contents of the rest of this blog:
Subject | More details |
---|---|
The example used | Explaining the methodology behind this speed comparison |
Temporary tables | The SQL code to generate and test a temporary table |
Table variables | The same code to generate and test a table variable |
Conclusion | The conclusion of the tests, giving relative speeds |
I'm running the tests in SQL Server 2016 under Windows 10 Professional, using this laptop:
The configuration of the laptop running these tests.
Let's start with the example I've used, which you can recreate in your own instance of SQL Server.
Parts of this blog |
---|
|
Some other pages relevant to the above blogs include:
Kingsmoor House
Railway Street
GLOSSOP
SK13 2AA
Landmark Offices
99 Bishopsgate
LONDON
EC2M 3XD
Holiday Inn
25 Aytoun Street
MANCHESTER
M1 3AE
© Wise Owl Business Solutions Ltd 2024. All Rights Reserved.