Raise an error manually in T-SQL to jump to BEGIN CATCH block

前端 未结 5 950
忘掉有多难
忘掉有多难 2021-02-03 19:12

Is it possible to raise an error in a stored procedure manually to stop execution and jump to BEGIN CATCH block? Some analog of throw new Exception() i

5条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-02-03 19:43

    THROW (Transact-SQL)

    Raises an exception and transfers execution to a CATCH block of a TRY…CATCH construct in SQL Server 2017.

    Please refer the below link

    T-SQL Throw Exception

提交回复
热议问题