simon
2010-03-03 19:00:21 UTC
Let's put a primary key on the table_name for columns (key_field,
key_field2)
THIS WILL WORK:
begin tran
update table_name set key_field = key_field + 1 where key_field2 =
some_value
rollback tran
go
-------------------------------------
THIS WILL ABORT with an error "attempt to insert duplicate key"
begin tran
update table_name set key_field = 2 where key_field = 1 and key_field2 =
some_value
update table_name set key_field = 3 where key_field = 2 and key_field2 =
some_value
rollback tran
go
-------------------------------------
The second writeup is what the first statement is usually unfolding to
during replication.
Makes you wonder why the first statement would then work.
It appears what works in production for a stand-alone ASE would need code
rewrites to accomodate replication.
--- news://freenews.netfront.net/ - complaints: ***@netfront.net ---
key_field2)
THIS WILL WORK:
begin tran
update table_name set key_field = key_field + 1 where key_field2 =
some_value
rollback tran
go
-------------------------------------
THIS WILL ABORT with an error "attempt to insert duplicate key"
begin tran
update table_name set key_field = 2 where key_field = 1 and key_field2 =
some_value
update table_name set key_field = 3 where key_field = 2 and key_field2 =
some_value
rollback tran
go
-------------------------------------
The second writeup is what the first statement is usually unfolding to
during replication.
Makes you wonder why the first statement would then work.
It appears what works in production for a stand-alone ASE would need code
rewrites to accomodate replication.
--- news://freenews.netfront.net/ - complaints: ***@netfront.net ---