Update statement doesn''t synchronize on SQL server 2000.

  • 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,

  • Louisa

    Why would one record overwrite another?  One of two things will happen.  If there is a UNIQUE constraint on process_ID then you will get an error message.  If not, you will get three tickets added, all with the same process_ID but with different (and presumably consecutive) ticket_numbers.  (Although if the SQL server receives the requests at the same time then the behaviour may depend on what transaction isolation level you are using... see Books Online for more information on that.)

    John

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply