SQL Server TRY CATCH FINALLY

前端 未结 6 2043
执笔经年
执笔经年 2021-02-06 23:09

I have a scenario where I need something similar to .NET\'s try-catch-finally block.

On my try, I will CREATE a #temp table, INSERT

6条回答
  •  孤城傲影
    2021-02-06 23:53

    there is no FINALLY equivalent.
    an alternative may be table variables but is not exactly the same and must be evaluated on a case by case basis.
    there is a SO question with details very useful to make an informed choice.
    with table variables you don't need to clean up like you do with temp tables

提交回复
热议问题