Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

Which is faster statement or preparedstatement?

945


What is the difference between dropping a database and taking a database offline?

1174


Explain the relational database management system (rdbms)?

1098


What is the difference between value type and reference type?

921


Explain index in sql server?

1012


Tell me when is the update_statistics command used?

1112


What is checkpoint in sql server?

1160


How will you monitor replication activity and performance? What privilege do you need to use replication monitor? : sql server replication

1079


on line cluster can we make if yes tell me the procedure

2023


Do you know what are acid properties of transaction?

958


What is resource db in sql server?

1024


What are the essential components of sql server service broker?

1018


What are the advantages of using stored procedures in sql server?

1011


Is it true that rules do not apply to data already existing in a database at the time the rule is created?

1042


what is the system function to get the current user's user id? : Sql server database administration

1022