What are the two virtual tables SQL Server maintains for
triggers?
Answer Posted / 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 |
Post New Answer View All Answers
What is table-valued sub query?
Data is not being delivered to subscribers, what can be the possible reasons? : sql server replication
How to disconnect from a sql server using mssql_close()?
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
Why do we use trigger?
Can we linked SharePoint to a SQL database?
What guidelines should be followed to help minimize deadlocks?
What is RMS migrations?
Does partitioning ssd reduce performance?
What is user defined stored procedures?
what are the different stages of Report Processing?
What is an inner join?
Which sql server table is used to hold the stored procedure script?
What is the data type of time?
How would you add a section to a table?