views:

766

answers:

1

Is it good design to throw exceptions from SQL CLR stored procedures? Since we are in the context of SQL Server, do any special considerations need to be made?

Is this bad design?

[Microsoft.SqlServer.Server.SqlProcedure]
public static void MyStoredProcedure(string foo)
{
    if (string.IsNullOrEmpty(foo))
    {
        throw new ArgumentNullException("foo");
    }
}

In other words, should exceptions be bubbled up to the caller?

+3  A: 

You might try reading this blog: SQL Programmability & API Development Team Blog.

Lucas McCoy