Why is TRY-CATCH block not allowed inside UDFs?

前端 未结 4 920
死守一世寂寞
死守一世寂寞 2021-02-11 21:54

Why doesn\'t SQL Server support TRY-CATCH blocks inside UDFs?

If we\'re talking about scalar UDFs, which are mostly used for calculations and conversations, this block s

4条回答
  •  醉梦人生
    2021-02-11 22:51

    Maybe it is because the overhead is too much - a scalar function could be called on a column as part fof a select and so be called thousands of times. If there was a reasonable overhead to allow try/catch it would slow it down horrendously.

提交回复
热议问题