拉风的咖菲猫
获取代码如下:BEGIN TRYSELECT 3 / 0END TRYBEGIN CATCHDECLARE @errornumber INTDECLARE @errorseverity INTDECLARE @errorstate INTDECLARE @errormessage NVARCHAR(4000)SELECT@errornumber = ERROR_NUMBER() ,@errorseverity = ERROR_SEVERITY() ,@errorstate = ERROR_STATE() ,@errormessage = ERROR_MESSAGE()SELECT @errornumber ,@errorseverity ,@errorstate ,@errormessageRAISERROR (@errormessage, -- Message text,@errorseverity, -- Severity,@errorstate, -- State,@errornumber);END CATCH