C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !




Interview Question


Posted Date: 30 Jun 2008      Total Responses: 5

Posted By: CRPRAJAN       Member Level: Gold     Points: 1



Under which situation we will use Magic Tables?




Responses

Author: chandramohan    30 Jun 2008Member Level: GoldRating:     Points: 1

http://www.dotnetspider.com/qa/Question11643.aspx

http://blogs.crsw.com/mark/articles/253.aspx

http://courtesyindia.com/software/interview/asp.net/welcome.aspx

http://www.crsw.com/mark/Lists/Posts/Post.aspx?ID=12

http://faisalmb.com/kbinterviewaspnet.html

http://www.dotnetspider.com/qa/Question11643.aspx

http://blogs.crsw.com/mark/articles/253.aspx

http://courtesyindia.com/software/interview/asp.net/welcome.aspx

http://www.crsw.com/mark/Lists/Posts/Post.aspx?ID=12

http://faisalmb.com/kbinterviewaspnet.html





Author: http://dotnetvj.blogspot.com    30 Jun 2008Member Level: DiamondRating:     Points: 6

Hi

There are 2 Magic Tables in SQL server Inserted and Deleted.
These are mantained by SQL server for Internal processing whenever an update, insert of delete occur on a table. However, we can refere these tables in a Trigger.
Whenever an update table statement is fired SQL server mantains the original row before updation in a deleted table and New (updated )row in a Inserted Table.

Same is the case when an insert is fired Only Inserted table is populated with inserted Row.
and when Delete table statement is fired Deleted table is populated with the deleted row.

Check out the below link for more information
http://www.sql-server-performance.com/nn_triggers.asp

Thanks -- Vj
http://dotnetvj.blogspot.com


Thanks -- Vj

http://dotnetvj.blogspot.com



Author: Bunty    30 Jun 2008Member Level: DiamondRating:     Points: 6

Hi,

Magic Tables:
Whenever a trigger fires in response to the INSERT,DELETE,or UPDATE statement,two special tables are created.These are the inserted and the deleted tables.They are also referred to as the magic tables.These are the conceptual tables and are similar in structure to the table on which trigger is defined(the trigger table).
The inserted table contains a copy of all records that are inserted in the trigger table.
The deleted table contains all records that have been deleted from deleted from the trigger table.Whenever any updation takes place,the trigger uses both the inserted and deleted tables.

Thanks and Regards
S.S.Bajoria


Thanks & Regards
S.S.Bajoria



Author: Sandesh S    01 Jul 2008Member Level: GoldRating:     Points: 0

In creating triggers we use the magic tables


Author: Ratheesh    01 Jul 2008Member Level: GoldRating:     Points: 1

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



Post Reply
You must Sign In to post a response.
Next : how to find freespace,totalspace,usedspace in database
Previous : data migration-urgent
Return to Discussion Forum
Post New Message
Category: SQL Server

Related Messages



dotNet Slackers   BizTalk Adaptors    Web Design


Contact Us    Privacy Policy    Terms Of Use