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

How to create user defined functions with parameters?

1222


How to execute the cursor queries with "open" statements?

1176


How many categories of functions based their return modes?

1101


How to connect php with different port numbers?

1078


Explain what is it unwise to create wide clustered index keys?

975


Which language is supported by sql server?

1007


What is difference between order by and group by?

1000


What is cdc in sql server?

992


What do you understand by replication in sql server?

1057


what is new philosophy for database devises for sql server 7.0? : Sql server database administration

1003


Why you need indexing? Where that is stored and what you mean by schema object? For what purpose we are using view?

902


How to delete multiple rows with one delete statement in ms sql server?

1019


What is SQL Azure Firewall?

136


What are the basic functions for master, msdb, model, tempdb and resource databases?

984


What is exporting and importing utility?

1078