HiI am deleting records from three tables and in one of the tables I keep getting one of the records left over. I can delete this by running the delete statement again but am trying to work out why it is not doing it the first time.The tables do not have any physical links but there is a common number that logically links the records. My script is like this:delete from LogRecordswhere OrderNumber = '12345678'GOdelete from OrderHoldwhere OrderNumber = '12345678'GOdelete from Orderswhere OrderNumber = '12345678'GO
In the logrecords table there are 4 messages like this:LogID LogMsg ===== ===============1 Order Registered2 Order Printed3 Order on Hold - Incorrect Invoice4 Order on hold not verifiedIn the OrderHold there is one record:HoldID HoldReason====== =================================1 Order on Hold - Incorrect InvoiceAnd one record in order:OrderID Order ======= ==========1 Staple GunWhen I run script it deletes all but this line:LogID LogMsg ===== ===============3 Order on Hold - Incorrect Invoice
Then if I run the part for deleting from Log it clears this record. I want to be able to run the script once and delete all records, and am wondering why this record is not being removed?Since there is no real dependancies I cannot see why this is not being removed.G