What are the two virtual tables SQL Server maintains for
triggers?

Answer Posted / sanjeev kumar

Two virtual tables are:
1) Inserted
2) Deleted

these two tables are also called magic table.
it has no any physical existence. it is used to keep trac of
the previous data when DML operation used.
it's used in a trigger.

Example:
Create trigger testtri on test3
for update
as
begin
declare @previousname varchar(50) -- local variable
select @previousname = del.name from deleted del
insert into test(name)values(@previousname)
end

Is This Answer Correct ?    7 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is mscorsvw.exe - process - microsoft .net framework ngen?

537


Define model database?

581


What is unique key constraint?

640


What is history table in sql server?

511


What is a heap?

627






What are various limitations of the views?

621


Is sql server free?

529


Explain different forms of normalization?

539


What is the dbcc command and why is it used?

578


Is it possible to call a stored procedure within a stored procedure?

566


What are data regions?

92


Can anyone tell that the extra features are there in SQL SERVER 2008 that are not available in previous versions .

1503


What’s the use of custom fields in report?

573


how to take backup bcp out for a column in table in sql server?

1648


How to enter binary string literals in ms sql server?

596