© Dmitri Korotkevitch 2016

Dmitri Korotkevitch, Pro SQL Server Internals, 10.1007/978-1-4842-1964-5_13

13. Temporary Objects and TempDB

Dmitri Korotkevitch

(1)Tampa, Florida, USA

Temporary objects are an essential part of SQL Server. SQL Server will sometimes create them during query execution to store working tables and intermediate result sets. At other times, they are created by developers.

In this chapter, we will discuss a few different types of temporary objects that can be created by users: local and global temporary tables, table variables, user-defined table types, and table-valued parameters. We will also talk about tempdb and ways to optimize its performance.

Temporary Tables

We create temporary tablesto store short-term information, such ...

Get Pro SQL Server Internals, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.