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

Answers were Sorted based on User's Feedback



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

Answer / laxman

OLD and NEW tables for oracle.

For sql server inserted & deleted.

Is This Answer Correct ?    19 Yes 0 No

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

Answer / 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

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

Answer / sri

The 2 virtual tables are the OLD and the NEW

OLD is invalid in the case of INSERT and NEW is invalid in
the case of DELETE statements

Inside the trigger we can use the OLD and NEW as follows

:OLD.columnname
:NEW.columnname

Is This Answer Correct ?    3 Yes 6 No

Post New Answer

More SQL Server Interview Questions

What is an indexing strategy?

0 Answers  


Hi Friends, I have a table in which there are thousands of records and in city field there is NULL value for all records now i want to change that null value with distinct values in each record say delhi, bihar, agra, jaipur etc, what will be the query for that????? its not possible to update thousands of records one by one. is there any alternative ...? Plz help ... its urgent Thanx in advance

1 Answers  


What is meant by Active-Passive and Active-Active clustering setup?

0 Answers  


What is a join and their types?

2 Answers   Challenger Financial,


Does hive support indexing?

0 Answers  






What do you understand by mirroring?

0 Answers  


What is difference between equi join and natural join?

0 Answers  


What are the triggers in sql?

0 Answers  


What is full form of XP ?

42 Answers   Cap Gemini, Infosys, Microsoft, Oracle, Reliance,


What is self contained scalar sub query?

0 Answers  


select empid empname from employee What is the result for the about query?

4 Answers  


The external application that is executed in one of the tasks does not have a log file, but only a screen log. How can I save the data from the screen? : sql server management studio

0 Answers  


Categories