O'Reilly logo

Microsoft SQL Server 2012 T-SQL by Debra Aaron, Tom Coffing

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 8 - Temporary Tables

Graffiti’s always been a temporary art form. You make your mark and then they scrub it off.”

- Banksy

There are three types of Temporary Tables in TEMPDB

Private Temporary Table

Is always created as #tablename

Space comes from tempdb

Can only be used by the connection that created the table

Can be created by the User, then populated with an INSERT/SELECT

Table and Data are deleted after the connection that created the table is

closed

Global Temporary Table

Is always created as ##tablename

Space comes from tempdb

Can be used by any connection  Can be created by the User, then

populated with an INSERT/SELECT

Table and Data are deleted after the creating connection is closed and all

queries running against the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required