Temporary tables are tables created in the TempDB database. These tables are session-specific tables, that is, even though they are backed by physical disk and logged into the transaction log, the tables are automatically dropped when the session is closed. As a result, temporary tables are usually not written on disk, but only saved in the plan cache memory.
Table variables, on the other hand, are created in the memory and exist there until the running of a single Transact-SQL (T-SQL) batch is completed. Unlike temporary tables, they do not require locking and are less I/O-intensive.
© ALL RIGHTS RESERVED. Feedback Conditions d’utilisation Confidentialité Cookie Preference Center