INSERTED and DELETED are two types of magic tables in SQL Server.
An INSERTED magic table is populated with INSERT and UPDATE operations and DELETED magic table is populated with UPDATE and DELETE operations.
Below are the limitations of the magic table compare to the actual temp table (# table)
- Users can not create any index or apply any constraint on the magic tables in SQL Server
- They can not be altered because the purpose of the magic
table is to audit the information in the system
A magic table is stored in the temp DB. Therefore, whenever you use the magic tables in SQL Server with the query statement, tempdb will come in the picture.