What is magic table in Sql server ?

 Posted by Rajkatie on 2/18/2012 | Category: Sql Server Interview questions | Views: 5227 | Points: 40

Sql Server automatically creates and manages two temporary, memory-resident tables (deleted and inserted tables) which are popularly known as magic tables.

Usually used with the DML triggers. Can not directly modify the data in the tables or perform ddl operation.

Primarily used to perform certain action like

1) Extend referential integrity between tables
2) Test for errors and take action based on the error.
3) Find the difference between the state of a table before and after data modification and take actions based on that difference.

Source: MSDN | Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response