Subject | Re: Getting duplicate records in a table |
---|---|
Author | Adam |
Post date | 2006-04-27T00:01:56Z |
Thanks Radu / Ann,
Radu,
The table is a notification table for a mini replication of a subset
of data.
Obviously I could declare the combination of FieldA, FieldB unique in
the first instance, but this would mean there would be a possibility
of losing information if a notification hit at the same time the
application checked in and removed the notification. The isolation
level would mean that the notification record insert would fail (which
could be caught using the -803 thing), but the application would not
see the latest version.
Your suggestion however has given me an idea that may work. I could
insert a new record in this notification table, then attempt to remove
any prior records (ignoring any exception if both a new notification
and an application synchronising attempt to delete simultaneously).
I will do some tests to see if this will solve my problem.
Adam
Radu,
The table is a notification table for a mini replication of a subset
of data.
Obviously I could declare the combination of FieldA, FieldB unique in
the first instance, but this would mean there would be a possibility
of losing information if a notification hit at the same time the
application checked in and removed the notification. The isolation
level would mean that the notification record insert would fail (which
could be caught using the -803 thing), but the application would not
see the latest version.
Your suggestion however has given me an idea that may work. I could
insert a new record in this notification table, then attempt to remove
any prior records (ignoring any exception if both a new notification
and an application synchronising attempt to delete simultaneously).
I will do some tests to see if this will solve my problem.
Adam