russellbcopeland
Programmer
I am using a cconnection to an SQL 2005 database from C# and am running my operatins within a transaction.
Within the transaction I delete a record in one ExecuteNonQuery then I Perform an Insert via ExecuteScalar. If the record I insert has values that conflict with the deleted records values in a unique index the inset fails and the transactin gets rolled back etc.
I have tried various isolation levels on my transaction but it still errors on the insert.
If the deletes are included with the insert block then the insert succeeds.
What am I missing? I thought that the insert would see the deleted version if I used an isolatin level of readuncommitted. Clearly I am missing something?
Any clues?
Within the transaction I delete a record in one ExecuteNonQuery then I Perform an Insert via ExecuteScalar. If the record I insert has values that conflict with the deleted records values in a unique index the inset fails and the transactin gets rolled back etc.
I have tried various isolation levels on my transaction but it still errors on the insert.
If the deletes are included with the insert block then the insert succeeds.
What am I missing? I thought that the insert would see the deleted version if I used an isolatin level of readuncommitted. Clearly I am missing something?
Any clues?