I agree it looks like there has been a Rollback transaction that got the one
in my code, thus causing the exception. The only problem is the stored
procedure does not contain any transaction statements. The only BEGIN,
COMIT, and ROLLBACK statements is is the C# method. This problem only seems
to occur when the specific exception is "The query processor could not
produce a query plan form the optimizer because a query cannot update a text,
ntext, or image column and the clustering key at the same time." All other
error that can or are expected to occur do not fail with this issue.
I seem to have two choices, changed my code to bracket the ROLLBACK with a
try-catch block, where I ignore the ROLLBACK's exception and hope the
ROLLBACK on the update occured. The second is to use an un-named ROLLBACK.
Right now I am still using the named ROLLBACK, but I have change the stored
procedure to handle the changing of the clustering key and data as seperate
UPDATE statements. Thus avoiding the only exception where the ROLLBACK logic
fails because SQL Server stepped on the named transaction.
I am not planning on converting to SQL Server 2005, but I hope this issue is
resolved, where a ROLLBACK only rolls back one transaction and not the lot.
When I have time I'll try to build a test case that causes the problem and I
will try it against SQL 2000 and 2005.
Thanks for everyone suggestions and assistance.
--
Jim
"mabster" wrote:
> Jim,
>
> Could this be related to the known issue where a ROLLBACK TRANSACTION on
> SQL Server 2000 rolls back ALL transactions, rather than just the most
> recent one?
>
> Check my blog post here:
>
> http://www.madprops.org/cs/blogs/mab...0/31/2984.aspx
>
> Hope this helps,
> Matt
>