What are the two virtual tables SQL Server maintains for
triggers?
Answers were Sorted based on User's Feedback
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 |
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 |
What is the role that is required for killing a process What is the role that is required for creating a linked server
1 Answers CarrizalSoft Technologies, IBM,
What is the difference between a "where" clause and a "having" clause?
What do you mean by a Composite primary key?
how many non clustered index in sql server 2008,2010,2012
What is de-normalization in sql database administration? Give examples?
What does REVERT do in SQL Server 2005?
Describe how to use linked server?
What is meant by indexing files?
How to convert a numeric expression from one data type to another?
hi, how to link a text file and a .rpt file in my tables of sql server and to retrieve those records for further use. reply me as soon as possible.
Difference between sql server 2000 and sql server 2005?
11 Answers Aditi Tech, eInfochips, GE, HCL, IBM, Masim Infotech, NIIT, Satyam, Systems Domain,
What is cursor ? And what is difference between Trigger ?
Oracle (3259)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)