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)
 Need some help on join

Author  Topic 

dyckwal
Yak Posting Veteran

58 Posts

Posted - 2005-11-03 : 05:27:13
Hello,
I know that cursor are not performing etc. But it is the only thing that works for me..
But I have a problem. When using the code below and when we have more than two records updated, I always get double number of records.
If 2 then the cursors seems to have 4, when 3 then it holds 6 etc...

Can someone explain this to me?? Please

DECLARE CursorSSCCInbound CURSOR FOR
SELECT i.Item_Code,
i.SSCC, i.Units,i.ID_Location, i.Status, i.Locked_Nbr,i.ID_Shipment, i.ID_Shipment_Out, d.ID_Location, d.Status, d.Locked_Nbr
FROM INSERTED i LEFT OUTER JOIN
DELETED d ON i.SSCC = d.SSCC

nr
SQLTeam MVY

12543 Posts

Posted - 2005-11-03 : 08:22:57
is SSCC a unique index on the table?
Is the trigger being fired twice?

==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

dyckwal
Yak Posting Veteran

58 Posts

Posted - 2005-11-03 : 08:29:12
Yes the SSCC is a unique key and how do I check to see if the trigger is fired twice ?
Go to Top of Page

dyckwal
Yak Posting Veteran

58 Posts

Posted - 2005-11-03 : 10:29:58
I found my problem, and the solution.

Thanks
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-11-04 : 01:18:47
What is the solution?

Madhivanan

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

- Advertisement -