SQL Database Concepts Question:
Download Job Interview Questions and Answers PDF
Explain what are Magic tables in SQL Server?
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.
-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 Question | Next 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? |