THE SQL Server Blog Spot on the Web

Welcome to - The SQL Server blog spot on the web Sign in | |
in Search

Browse by Tags

All Tags » Error Handling   (RSS)
  • The client code that handles timeouts

    After timeouts we need to make sure that active transactions, if any, are rolled back. All timeout handling must be done on the client. This post provides the implementation and unit tests. Implementation The following class extends SqlCommand and rolls back active transactions after timeouts:     public static class ...
    Posted to Alexander Kuznetsov (Weblog) by Alexander Kuznetsov on January 10, 2013
  • After the timeout

    After the timeout, we may sometimes, but not always, end up with an outstanding transaction. If this is the case, we need to rollback the transaction ourselves. Otherwise the consequent commands which use the same connection might not work as expected. Let us debug through some client code and see what is happening in more ...
    Posted to Alexander Kuznetsov (Weblog) by Alexander Kuznetsov on January 9, 2013
  • Catching multiple exceptions on the client is robust and easy

    Maria Zakourdaev has just demonstrated that if our T-SQL throws multiple exceptions, ERROR_MESSAGE() in TRY..CATCH block will only expose one. When we handle errors in C#, we have a very easy access to all errors. The following procedure throws two exceptions: CREATE PROCEDURE dbo.ThrowsTwoExceptionsAS   BEGIN ...
    Posted to Alexander Kuznetsov (Weblog) by Alexander Kuznetsov on June 6, 2012
  • SQL Server v.Next (Denali) : Exploring THROW

    Sadly, THROW is not mentioned on the Programmability Enhancements (Database Engine) topic of Denali's ''What's New'' section.  So, unless you were at PASS or have been reading the various blogs from the keynotes and other Denali sessions, the presence of this keyword may be news to you.  I wanted to touch briefly on what THROW can do ...
    Posted to Aaron Bertrand (Weblog) by AaronBertrand on November 22, 2010

    Transact-SQL is a great language for data manipulation, but it has its weaknesses. Unlike “real programming languages” T-SQL is confined to procedural code. Sure, you can build “modules” by using stored procedures and functions, but for the most part, all of the work will be procedural. It has in the past also lacked error handling syntax leaving ...
    Posted to Eric Johnson (Weblog) by ejohnson2010 on October 12, 2010
  • Connect Digest : 2010-01-22

    Give us easier to read execution plansMichelle Ufford (@SQLFool) recently asked for help pinpointing the most expensive node(s) in a complicated execution plan.  Mladen Prajdic (@MladenPrajdic) has a useful workaround; he coded up a quick query to parse the showplan XML and order results by cost descending.  The Connect item that would ...
    Posted to Aaron Bertrand (Weblog) by AaronBertrand on January 22, 2010
  • Connect Digest : 2009-10-30

    Light helping this week.  I am busy closing out a few projects (or at least chapters within projects) in preparation for PASS next week. ======================================== #506453 : Lock escalation no longer kicks in for INSERTs in SQL Server 2008 Adam found a nasty lock escalation bug in SQL Server 2008.  This one ...
    Posted to Aaron Bertrand (Weblog) by AaronBertrand on October 30, 2009
  • Connect digest : 2009-10-17

    I've been fairly distracted this past week with my ''Bad habits to kick'' series, so apologies for being so late with the Connect digest.  I stumbled upon a few pretty interesting items from the past two weeks; I hope you find them interesting as well. #498082 : Allow direct usage of scalar functions in RAISERROR() It has bugged me that in ...
    Posted to Aaron Bertrand (Weblog) by AaronBertrand on October 17, 2009
  • Gracefully Handing Task Error in SSIS Package

    I am sure that there is already some blog or article about this. But, I encountered this today and decided to go ahead and blog anyway. I had a situation, where I expected at certain times (the first of every month), a task to fail, but regardless, I wanted the package to continue to run with success. One other issue, I had, was that I did not ...
    Posted to Rushabh Mehta (Weblog) by RMehta on April 24, 2008
Privacy Statement