SQL Try Catch
生活随笔
收集整理的這篇文章主要介紹了
SQL Try Catch
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
--開啟xact_abort?(預設為關閉)
set?xact_abort?on
begin?try
--begin?tran
--?批次處理
--print?1/0
--commit?tran
end?try
begin?catch
--rollback?tran
--異常處理,例如print?error_number(),?error_saverity(),?error_message()
--print?error_number()
end?catch
set?xact_abort?on
begin?try
--begin?tran
--?批次處理
--print?1/0
--commit?tran
end?try
begin?catch
--rollback?tran
--異常處理,例如print?error_number(),?error_saverity(),?error_message()
--print?error_number()
end?catch
轉載于:https://www.cnblogs.com/RobotTech/archive/2008/01/02/1023029.html
總結
以上是生活随笔為你收集整理的SQL Try Catch的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 一个人的故事
- 下一篇: JAVA程序员面试32问(答案)