Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


What are the magic tables in SQL Server 2000?

Answers were Sorted based on User's Feedback



What are the magic tables in SQL Server 2000?..

Answer / kirti kumar agarwal

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.
Note that the Magic Table does not contain the information
about the columns of the data-type text, ntext, or image.
Attempting to access these columns will cause an error.

Is This Answer Correct ?    44 Yes 3 No

What are the magic tables in SQL Server 2000?..

Answer / maya

While using triggers these Inserted & Deleted tables
(called as magic tables) will be created automatically.

When we insert any record then that record will be added
into this Inserted table initially, similarly while
updating a record a new entry will be inserted into
Inserted table & old value will be inserted into Deleted
table.

In the case of deletion of a record then it will insert
that record in the Deleted table

Is This Answer Correct ?    40 Yes 5 No

What are the magic tables in SQL Server 2000?..

Answer / jerry joseph

NO THERE IS NO UPDATED MAGIC TABLE

only 2 magic tables

- INSERTED
- DELETED

in case of an Update operation the original row is stored in
the DELETED table and the new row is saved in the INSERTED table

Is This Answer Correct ?    31 Yes 0 No

What are the magic tables in SQL Server 2000?..

Answer / deepak rawat

The tables "INSERTED" and "DELETED" are called magic tables
of the
SQL Server. We can not see these tables in the data base.
But we can access these
tables from the "TRIGGER"

When we insert the record into the table, the magic
table "INSERTED" will be created
In that table the current inserted row will be available.
We can access this
record in the "TRIGGER".


When we delete the record from the table, the magic
table "DELETED" will be created
In that table the current deleted row will be available. We
can access this
record in the "TRIGGER".

Following code Explain the magic table "DELETED"

CREATE TRIGGER LogMessageON EMPFOR DELETEAS DECLARE
@EMPNAME varchar(50) SELECT @EMPNAME= (SELECT EMPNAME
FROM DELETED) INSERT INTO LOGTABLE(UserId,Message) values
(@EMPNAME,'Record Removed')GO


The magic tables "INSERTED" and "DELETED" are main concept
of the "TRIGGER".
By using these tables we can do lot of useful
functionalities. The above code is
used to update the "LOGTABLE"

Is This Answer Correct ?    12 Yes 2 No

What are the magic tables in SQL Server 2000?..

Answer / ajay sadyal

Hi Friends

Magic table are created when we execute the DML statement
like insert,update and delete on database..

But these magic table are not accessible directly.You can
access these table only with triggers.
Becuase these table are only in the scope of triggers.

e.g deleted and inserted are two magic table..

CREATE TRIGGER [dbo].[EMPLOYEE_trgU]
ON [dbo].[EMPLOYEE]
FOR UPDATE AS
BEGIN
declare @name varchar(40)

SELECT @name = name from deleted WTIH (NOLOCK)

-- WITH (NOLOCK) enforce the sql-server not to Lock -
-- the data if there is any transaction implemented.

-- Now Update it with another table

UPDATE tbl_employee_log
SET description = @name + ' record has been deleted
from database'


END

Hope this will help.

Is This Answer Correct ?    5 Yes 1 No

What are the magic tables in SQL Server 2000?..

Answer / kuber

is there any new table named "update magic table"???

Is This Answer Correct ?    6 Yes 23 No

What are the magic tables in SQL Server 2000?..

Answer / vijayabhaskarreddy

wen we are performing DML operations into table . amagic
table created in the memory.
inserted magic table
deleted magic table
update magic table

Is This Answer Correct ?    3 Yes 21 No

Post New Answer

More SQL Server Interview Questions

What are the advantages of using sql server over ms access or why should one use sql instead of ms access

2 Answers   CMS, Impetus,


How many triggers you can have on a table?

0 Answers  


What area unit the various kinds of info compression introduced in sql server 2008?

0 Answers  


what is node in sql server?

2 Answers   CarrizalSoft Technologies, Google, NIIT, Nittany, TATA,


How to get number of days in a given year?

4 Answers   ADP,


What do you mean by the term 'normalization'?

0 Answers   Tech Mahindra,


Why main is user defined function?

0 Answers  


How To Make password Protected SQL Server 2005 Database i.e when i open SQL Server database then ask for password.

1 Answers  


Define ACID properties in a Database?

0 Answers   iNautix,


What is the difference between functions and stored procedures?

0 Answers   Accenture,


How to specify the collation for a character data type in ms sql server?

0 Answers  


Mention the command used to rename the database.

0 Answers  


Categories