What are the magic tables in SQL Server 2000?
Answer Posted / ajay sadyal
Hi Friends
Magic table are created when we execute the DML statement
like insert,update and delete on database..
But these magic table are not accessible directly.You can
access these table only with triggers.
Becuase these table are only in the scope of triggers.
e.g deleted and inserted are two magic table..
CREATE TRIGGER [dbo].[EMPLOYEE_trgU]
ON [dbo].[EMPLOYEE]
FOR UPDATE AS
BEGIN
declare @name varchar(40)
SELECT @name = name from deleted WTIH (NOLOCK)
-- WITH (NOLOCK) enforce the sql-server not to Lock -
-- the data if there is any transaction implemented.
-- Now Update it with another table
UPDATE tbl_employee_log
SET description = @name + ' record has been deleted
from database'
END
Hope this will help.
| Is This Answer Correct ? | 5 Yes | 1 No |
Post New Answer View All Answers
Explain features of analysis services?
Is mysql better than sql server?
What is the simplest way to create a new database in ms sql server?
What is the purpose of the tempdb database?
What language is sql server written in?
What is report server project?
Comment,Datatypes are unlimited
Does a server store data?
Tell me what is log shipping?
Explain subquery and state its properties?
Why it is recommended to avoid referencing a floating point column in the where clause?
How do I create a stored procedure in sql server?
What the different types of Replication and why are they used?
What are the steps you will take to improve the performance of a poor performing query?
wat wil hapn if we give the both read and deny read permission to user?