SQL Database Concepts Question:
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.
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? |