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 |
Write a code to select distinct records without using the DISTINCT keyword.
you have separate development and production systems you want to move a copy of a development database into production to do this, you do a backup on the development system and restore to the production system after a few minutes, you begin getting calls from several customers saying that they are denied access to the system why? : Sql server administration
What is buffer cash and log cache in sql server?
what is denormalization and when would you go for it? : Sql server database administration
we have emp table like Ename,EDOJ,EDOB with Column structure.but we want to know the employee Age.How? Any Body Plz
What is a recursive stored procedure in sql server?
How to convert numeric values to integers in ms sql server?
List out the different types of locks available in sql server?
Do you know what is normalization of database? What are its benefits?
What are the five major components of a dbms?
Name three version of sql server 2000 and also their differences?
Do you know sql server 2008 introduces automatic auditing?
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)