Archive for March 18th, 2011

Troubleshooting a “Doomed” SQL Server Transaction

Recently we encountered an unusual error message:

System.Exception: sprocname_Exception: The current transaction cannot be committed and cannot support operations that write to the log file. Roll back the transaction.

It seems we’ve hit a corner case. This apparently happens when you have a TRY/CATCH exception handling mixed with old style exception handling (see Alexander Kuznetsov’s article), which may lead to an “uncommittable” transaction.

What’s an “uncommittable” transaction? In our case, we had a stored procedure that inserts records to a table that has an insert trigger. By default in the stored proc, XACT_ABORT if OFF, but in the trigger we turned it on. If an error is thrown in the trigger and caught by the CATCH block, this transaction is technically uncommittable hence we get the error.

So to fix, either:
– Set ARITHABORT to OFF.
– Use Remus Rusanu’s template for error handling in stored procedures

We went with Remus Rusanu‘s template. Problem fixed. Thanks Remus!

VN:F [1.9.22_1171]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.22_1171]
Rating: +1 (from 1 vote)

Great SQL Server Free Video Resources

More of a note to self (ie a list of videos that I’d like to watch at least a few times), but hopefully this list would be useful to you too. Great video resources, a wealth of information. Thanks to the people who created these great videos and made them available to the community.

DBA

in a heap – in no particular order
MCM Readiness Videos
– http://technet.microsoft.com/en-us/sqlserver/ff977043

SQLServerPedia
– http://sqlserverpedia.com/wiki/SQL_Server_Training

QuestLive
– http://db-management.com/live/

Technet SQL Server 2008 Videos
– http://www.microsoft.com/events/series/technetsqlserver2008.aspx?tab=videos

SQLShare
– http://www.sqlshare.com

SQLServerVideos
– http://www.sqlservervideos.com/

Brent Ozar – Video Tutorials
– http://www.brentozar.com/sql-server-training-videos/

MidnightDBA
– http://midnightdba.itbookworm.com/AllVids.aspx

MSDev
– http://msdev.com/

Technet SQL Server How Do I videos
– http://technet.microsoft.com/en-us/sqlserver/dd353197.aspx

BI/Dev

in a heap – in no particular order
Pragmatic Works
– http://pragmaticworks.com/Resources/webinars/Default.aspx

SQLShare
– http://www.sqlshare.com

Idera On Demand WebCasts
– http://www.idera.com/Content/Resources.aspx#WC

Prologika SSRS Video Demos
– http://www.prologika.com/Books/0976635313/Video/amrs2008.html

Enjoy!

VN:F [1.9.22_1171]
Rating: 10.0/10 (4 votes cast)
VN:F [1.9.22_1171]
Rating: 0 (from 0 votes)
`