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
 Transact-SQL (2000)
 "inserted" table

Author  Topic 

lebedev
Posting Yak Master

126 Posts

Posted - 2002-06-09 : 22:19:27
Hi,
I am wondering if it is possible to use "inserted" virtual table from a procedure called from the INSERT trigger? Or is this table accessible within an INSERT trigger only? I would like to split my trigger into smaller procedures, but I am getting an error saying:
Invalid object name 'inserted'.
Thanks,

Alec


robvolk
Most Valuable Yak

15732 Posts

Posted - 2002-06-09 : 22:56:51
Yes, the inserted pseudo-table is only available within a trigger. You can however take the data from the inserted table and dump it into a temp table:

CREATE TRIGGER testTrig ON myTable FOR INSERT AS
SELECT * INTO #tempInserted FROM inserted
EXEC spDoesMoreWork


Be advised that this can cause a lot of performance bottlenecks if there is a lot of insert activity, so you should be very careful and MONITOR the actual performance, using the Performance monitor or Profiler.

Go to Top of Page
   

- Advertisement -