tags:

views:

309

answers:

4

What are the magic tables available in SQL Server 2000?

I wonder, why they are 'magic' tables?

+1  A: 

GIYF:

The INSERTED and DELETED tables, popularly known as MAGIC TABLES, and update () and columns_updated() functions can be used to determine the changes being caused by the DML statements.

ammoQ
+1  A: 

The 'magic tables' are the INSERTED and DELETED tables, as well as the update() and columns_updated() functions, and are used to determine the changes resulting from DML statements.

  • For an INSERT statement, the INSERTED table will contain the inserted rows.
  • For an UPDATE statement, the INSERTED table will contain the rows after an update, and the DELETED table will contain the rows before an update.
  • For a DELETE statement, the DELETED table will contain the rows to be deleted.

The primary use of these tables are for more complex operations when triggers are fired.

The Lazy DBA
A: 

SELECT * FROM sysobjects WHERE TYPE = 'S' ORDER BY name ?

Galkin
A: 

Google returned this in 0.23 sec

rahul