Magic Tables
Magic tables are nothing but the logical tables maintained by SQL server internally.
There are two types of Magic tables available in SQL server:
- Inserted
- Deleted
We can not see or access these tables directly, not even their data-type. The only method to have access to these tables is Triggers operation either After Trigger or Instead of trigger.
Inserting into Table (Inserted Table):
Whenever we do insert anything in our base table in database, a table gets created automatically by the
SQL server, named as INSERTED. In this table current updated or inserted record will be available. we can access this table of record via triggers.
Updating Table (Inserted & Deleted Table):
Whenever we do any deletion operation on our base table, in spite of one, two tables are created, one is INSERTED and another is called DELETED. Deleted table consist of the current record after the deletion operation and Inserted table consists of the previous record. We can access it via Triggers functionality.
Deleting (Deleted Table):
Whenever we do deletion in base table in database, a table gets created automatically by the SQL server, named as
DELETED table. This table consist of current updated record after deletion operation. Again we can have access to these records via triggers.

Ashish KharePosted Jun 21, 2017, 11:35 AM
In updating table also you mentioned........... deletion word in first line which is supposed to be updation. Please change it........ Remaining good explanation. Thanks
Md RaquibPosted May 23, 2017, 2:29 PM
In Case of updating and deleting , it is so confusing .. In Both case u r talking about deletion
Deepak KumarPosted Sep 29, 2016, 5:05 AM
Can we use Magic table in Store procedure?
Vishal JadhavPosted Apr 14, 2016, 3:41 AM
Hi. Explanation is pretty good. It would be better to see an example or code on this. :)
jamal bashaPosted Jan 25, 2016, 5:27 AM
Nice Share.
Abhishek JaiswalPosted Jan 27, 2015, 10:56 AM
Ashwani Taneja ??
Ashwani TanejaPosted Jan 27, 2015, 10:53 AM
lkmkm