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 joins please explain breffly ??

1 Answers   Adaequare, TCS,


How do I find the default sql server instance?

0 Answers  


1. What are the grouping function in SQL ? 2. If base table of a view deleted means, what will happen while we querying on view ? will give any error ? 3. Difference between DROP, DELETE, TRUNCATE table ? 4. What is constraints and types ? 5. What is max size of nchar & nvarchar ? 6. Define ROLLBACK, COMMIT, SAVE POINT 7. How non-clustered better ? or rank the Clustered, Non-Clustered and Table scan in performance wise 8. Select 10 rows from a table ? 9. Define DML, DDL, DCL, DTL commands ? 10. What is mean by NULL value ? NULL means "" or 0 or undefined ? 11. Default constraints ? 12. Can we have more then primary Key in table ? 13. Type of integrity ? Entity, Referential, Domain ?

10 Answers   Perot Systems,


How to restore performance issues and how to check?

0 Answers  


What is relationship? What number of sorts of relationship are there?

0 Answers  






How do you make a trace?

0 Answers  


Suppose in a situation if two list boxes are there and if you select multiple options based on that the options related to those selected items should display in second list box. Again if we select multiple items in second listbox then the related to those selected items should display . In this scenario how will you design database,tables?

1 Answers   HP,


Can you tell me about the concept of ER diagrams?

0 Answers  


Explain what are db_options used for?

1 Answers   InterGraph,


You want to be sure that queries in a database always execute at the maximum possible speed. To achieve this goal you have created various indexes on tables which other statement will keep the database in good condition?

0 Answers  


How much is a sql server license?

0 Answers  


What is the difference between writing data to mirrored drives versus raid5 drives

0 Answers  


Categories