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 2005 Forums
 Transact-SQL (2005)
 accessing row wise record in multiple data trigger

Author  Topic 

imranabdulaziz
Yak Posting Veteran

83 Posts

Posted - 2009-04-09 : 08:39:50
I am using sql server .
I write a trigger on a table which after insert , insert the data in different tables. It work fine but in case of multiple records uploded at the same time then it insert last record only
I want to know how in such case we insert each record correctly.

ayamas
Aged Yak Warrior

552 Posts

Posted - 2009-04-09 : 09:26:35
Please post sample of the code.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-04-10 : 07:03:12
you need to join onto inserted table in your trigger rather than storing values of fields from inserted table onto variables in trigger. i think you're doing it latter way which is why you get only last records details alone
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2009-04-10 : 07:07:54
quote:
Originally posted by imranabdulaziz

I am using sql server .
I write a trigger on a table which after insert , insert the data in different tables. It work fine but in case of multiple records uploded at the same time then it insert last record only
I want to know how in such case we insert each record correctly.



Post the trigger code. I think you are using variable as Visakh says

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

dsindo
Starting Member

45 Posts

Posted - 2009-04-10 : 17:03:54
insert records to other tables using an inner join with the inserted table that gets created when trigger fires.
Go to Top of Page
   

- Advertisement -