SQL Database Concepts Question:

Download Job Interview Questions and Answers PDF

Explain what are Magic tables in SQL Server?

Basic SQL Server Interview Question
Basic SQL Server Interview Question

Answer:

-In SQL Server there are two system tables “Inserted” and “Deleted” called Magic tables.

-These are not the physical tables but the virtual tables generally used with the triggers to retrieve the inserted, deleted or updated rows.

-When a record is inserted in the table that record will be there on INSERTED Magic table.

-When a record is updated in the table that existing record will be there on DELETED Magic table and modified data will be there in INSERTED Magic table.

-When a record is deleted from that table that record will be there on DELETED Magic table.

Download Basic SQL Server Interview Questions And Answers PDF

Previous QuestionNext Question
Do you know what are the steps to process a single SELECT statement?Explain what are the restrictions while creating batches in SQL Server?