SQL异常处理语句

BEGIN TRY
END TRY
BEGIN CATCH
SET @InfoBar=ERROR_MESSAGE()
SET @Severity=16
EXEC dbo.RaiseErrorSp @Infobar = @InfoBar,
@Severity = @Severity, -- int
@State = 0 -- int    
RETURN @Severity
END CATCH

posted @ 2017-12-11 19:17  温故余学  阅读(569)  评论(0编辑  收藏  举报