What is the Magic Tables in Sqlserver2000?

 Posted by Chikul on 12/21/2009 | Category: Sql Server Interview questions | Views: 2926

In Database for any table or view When a trigger is fired for any DML command.
Then 2 tables automatically create on backend.
One table is for Insert and other one is for Delete.
These tables are called Magic Tables.
Number of records in both tables should be same.

Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Posted by: Amatya on: 8/4/2015 | Points: 10
Magic tables are inserted and deleted table that are temporary objects which is created by the server internally to hold recently inserted values (in the case of insert) and to hold recently deleted values (in the case of delete) to hold before updating values or after updating values in the case of update.
Just imagine if we write a trigger on the table on insert or delete or update. So on insertion of a record into that table, the inserted table will be created automatically by the database, on deletion of record from that table; the deleted table will be created automatically by the database.
These two tables, inserted and deleted, are called magic tables.

Login to post response