Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Trigger Tables

Author  Topic 

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-05-04 : 09:56:58
Where can I find the informations about the Trigger tables Inserted, Updated and Deleted? They are not available in sysobjects. Are they created and deleted after trigger is fired?

Madhivanan

Failing to plan is Planning to fail

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2005-05-04 : 10:00:08
they aren't real tables. they are pseudo table that are created in the trigger.
and what would you like to know about them?
they have exact same structure as the table the trigger is on except the text, ntext and image columns.

Go with the flow & have fun! Else fight the flow
Go to Top of Page

cshah1
Constraint Violating Yak Guru

347 Posts

Posted - 2005-05-04 : 10:08:02
From the BOL

-------------------------
Two special tables are used in trigger statements: the deleted table and the inserted table. Microsoft® SQL Server™ 2000 automatically creates and manages these tables. You can use these temporary, memory-resident tables to test the effects of certain data modifications and to set conditions for trigger actions; however, you cannot alter the data in the tables directly.

SQL Server 2000 does not allow text, ntext, or image column references in the inserted and deleted tables for AFTER triggers; however, these column references are allowed for INSTEAD OF triggers
-------------------------

Mladen, just one thing..where does SQL stores these tables in memory or in tempDb?
Go to Top of Page

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2005-05-04 : 10:17:35
well i'd say it depends on the size of the tables.
as i haven't seen any references about it in BOL i drew a conclusion from table variable.
if the pseudo table is too big is written to the tempdb otherwise to the memory.
I may be worng here of course.

Go with the flow & have fun! Else fight the flow
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2005-05-04 : 10:42:45
Cross post



http://www.dbforums.com/t1154582.html



Brett

8-)
Go to Top of Page
   

- Advertisement -