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

Explain syntax for disabling triggers?

0 Answers  


What is model database in sql server?

0 Answers  


What is the difference between stored procedure and user defined functions?

0 Answers  


How connect excel to sql server?

0 Answers  


Explain system functions or built-in functions? What are different types of system functions?

0 Answers  






What are the steps to take to improve performance of a poor performing query? : sql server database administration

0 Answers  


I applied Transactional with updatable subscriptions replication on 2 tables now i want to delete those 2 tables but i cannot delete those tables as replication is running how can i stop replication for those 2 tables(but i don't want to delete those replicated tables but i need to stop the replication) how can i do that

0 Answers  


What is the difference between IN and EXISTS operators in SQL Server?

9 Answers   ASD Lab, CSC, Intelligroup,


What is the difference between lock, block and deadlock? : sql server database administration

0 Answers  


What is the query and subquery?

0 Answers  


why cluster and non clusterindex are used in sqlserver 2000? explain with example

1 Answers  


What is a primary key?

0 Answers  


Categories