close

Privacy guaranteed - Your email is not shared with anyone.

MS SQL Help Needed

Discussion in 'Tech Talk' started by IHR, Dec 3, 2004.


  1. IHR

    IHR
    Expand Collapse
    Appaloosa Rider

    Joined:
    Jan 5, 2003
    285
    0
    Location:
    Monroe, WA.
    I have a trigger that seems to be causing a race condition, but I just dont know.

    create trigger trig_UPS_Update
    on orders
    for insert
    as
    insert into UPS_Shipping
    select * from vw_UPS_Shipping vs
    where vs.[order number] not in ( select iOrder from UPS_Shipping)

    (vw_UPS_Shipping is a view built from selected columns of orders.)

    Could the above trigger cause a DB to crash because of a race condition. I suspect that if too many orders come in one after another, and the sub select has any kind of delay, that would do it.

    Comments?

    I've replaced this trigger with a stored proc that is run every so often.