• I'd be interested to see if anyone has a solution to the problem of preventing a barf when an invalid path is passed to DirectoryInfo. The obvious idea would be to send a RAISERROR through the Pipe to the SQLExecutionContext via ExecuteAndSend(). The error should be caught by the outer exception handling of the TSQL TRY....CATCH block so you can then do something sensible. However, in SQL Server 2005, the error is thrown back to the CLR and handled as SQLExpection. If the SQLException is caught within the CLR and nothing is done within the CLR CATCH block, then the execution will fail in the T-SQL context with an error, instead of being caught by the TSQL-TRY/CATCH Block. (Jens Suessmeyer in http://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=251376)

    Best wishes,
    Phil Factor