programming/MSSQL
Error Handling in SQL Server – a Background
happy4u
2005. 4. 11. 17:33
SET XACT_ABORT ON
문 사용 중.
실행 에러가 아닌 사용자 정의 에러를 처리하는 부분에 대한 내용을 보다가 또 찾게된 좋은 글. 아래 글에서 따라 가서 알게 되었습니다.
역시 첨부하고.. 특별히 제가 오늘 알게되서 알려 드리고 싶은 부분은 따로 소개합니다.
Beware, though, that even when XACT_ABORT is ON, not all errors terminate the batch. Here are the exceptions I know of:
- Errors you raise yourself with RAISERROR.
- Compilation errors (which normally terminate the scope) do not terminate the batch.
- Error 266, Transaction count after EXECUTE indicates that a COMMIT or ROLLBACK TRANSACTION statement is missing.
저는 XACT_ABORT ON 문 사용시, RAISERROR문을 만나면 당연히 자동 rollback이 될거라 생각했는데.. 아니더군요..
위 문단은 저자가 알고 있는 자동 rollback이 되지 않는 예외 사항들에 대한 내용입니다.
혹시 사용하시는 분은 참고로 알고 계셔야 할 듯..