April 26, 2006 at 9:14 am
Update statement doesn't synchronize on SQL server 2000.
This is a query:
Update ticketNumber set process_ID ='MachineName-'+Convert(Varchar, GetDate(), 21) where ticket_number = (select min(ticket_number) from ticketNumber where process_ID is null)
Execute this Update query on three PCs and push is on same time.
If time is exact same, one record will be overwrite another record. From the result tell me "Update" on SQL server is not synchronized at millisecond point on SQL server 2000.
Let me know this is the bug on SQL server or some wrong on query.
Thanks,
April 27, 2006 at 7:41 am
You have a design problem. How is the ticketNumber row inserted? If you need to update a column after an insert, you may need to wrap it in a transaction. It looks like a row is inserted into ticketNumber with a NULL process_ID, which you subsequently update (in a trigger?).
If all three PC's execute the UPDATE at approximately the same time, there may be up to 3 rows that satify the criterion WHERE process_ID IS NULL.
What column or columns comprise the primary key for the ticketNumber table?
I would need to see the table structure for ticketNumber, plus all the code for the INSERT/UPDATE process to say for sure what the problem is.
Viewing 2 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply