Trigger (insert) and @@identity problem...

Trigger (insert) and @@identity problem...

Post by Andreas Klem » Mon, 05 Nov 2001 06:58:39



Hello!!

I have table A and I have programmed an INSERT  Trigger for that.
This TRIGGER inserts in table B a row.

the ID from table B.

Question: How can I get the ID from table A ??

Thanks a lot!!!

 
 
 

Trigger (insert) and @@identity problem...

Post by Hiep Trong Nguye » Mon, 05 Nov 2001 08:00:07


SQL 2K comes with scope_identity(), and table identity , with return the

identity of the last table that the trigger triggered.

Hope this help,
Hiep


> Hello!!

> I have table A and I have programmed an INSERT  Trigger for that.
> This TRIGGER inserts in table B a row.

> the ID from table B.

> Question: How can I get the ID from table A ??

> Thanks a lot!!!


 
 
 

1. insert, @@identity and triggers... HELP

I have a database being developed that now requires me to insert entries
into another table from a trigger when an insert occurs on the main table.
(The clients changed the spec during development... AAARRRGH)


being inserted as the trigger is adding information after the original
insert so my original entries identity is lost.

I have read through the NG and noticed solutions for SQL2000 but I am
developing on SQL7 which does not have the extra variables that should have
been in place well before SQL2000.

Anyone have any ideas how to code around this.

Many thanks

Warren Leggatt

--
...

2. Options for Accessing SQL Server without a Domain Server?

3. @@Identity From Tables w/Triggers That Performs INSERTs

4. Oracle, Objects and Relational Model

5. @@IDENTITY and INSERT Triggers

6. Error 208 On Saving Stored Procedure that Creates and References Temporary Tables

7. INSTEAD OF INSERT trigger on view with identity column requires value

8. bitte um restore auf solaire...

9. insert trigger on table with identity field

10. Repost: Identity insert from trigger not possible?

11. Using @@Identity after an Insert Trigger occurs

12. @@Identity From Tables w/Triggers That Performs INSERTs

13. implement auto-number(identity) field in insert trigger?