Why is TRY-CATCH block not allowed inside UDFs?

前端 未结 3 1590
执笔经年
执笔经年 2021-02-11 21:59

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

3条回答
  •  情歌与酒
    2021-02-11 22:33

    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.

提交回复
热议问题