views:

49

answers:

3

All language like C#,VB.NET all have try catch finally block but SQL server only have try and catch only why not finally block is given is there any specific reason for that?

A: 

It's because the default error handling is often good enough. It used to be hard to write code which could compile but cause some bad fault.

wallyk
+2  A: 

In my opinion TRY/CATCH/FINALLY is very much a procedural programming method and therefore does not really have a place or need to be included within T-SQL, what is considered to be very much a SET based programming language.

As wallyk states and I agree, the existing TRY/CATCH Block in T-SQL caters for the vast majority of requirements.

I wonder if perhaps you are trying to implement complex process logic that would be better housed/managed in the application tier.

John Sansom
+2  A: 

There are many other problems with TRY...CATCH block, such as you cannot rethrow an error exactly as you caught it, so I would use C# error handling for anything complex. I have wrote a whole book chapter on it, you can download a free pdf here

AlexKuznetsov