Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
TajKazi
Posting Yak Master
101 Posts |
Posted - 2014-09-18 : 10:16:03
|
how to migrate exception handling script from oracle to sql server 2008 |
|
gbritton
Master Smack Fu Yak Hacker
2780 Posts |
Posted - 2014-09-18 : 10:20:35
|
post some sample oracle exception handling code. let's see if we can translate it! |
|
|
TajKazi
Posting Yak Master
101 Posts |
Posted - 2014-09-18 : 23:44:48
|
exception when others then rollback; usp_iserror := 1; pkg_exception_handler.usp_raise_error(-20001,pkg_atnot_configs.c_application_id,'pkg_atnot_main.usp_add_backdate_entry'); |
|
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2014-09-19 : 01:45:05
|
Use TRY...CATCH block:BEGIN TRANBEGIN TRY -- some code hereEND TRYBEGIN CATCH IF @@TRANCOUNT > 0 ROLLBACK TRAN SELECT ERROR_NUMBER() AS ErrorNumber, ERROR_LINE() AS ErrorLine, ERROR_MESSAGE() AS ErrorMessageEND CATCHIF @@TRANCOUNT > 0 COMMIT TRAN Harsh Athalyehttp://www.letsgeek.net/ |
|
|
Upendra Gupta
Starting Member
12 Posts |
Posted - 2014-09-19 : 06:12:00
|
unspammed |
|
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2014-09-19 : 06:16:32
|
Please don't spam here!Harsh Athalyehttp://www.letsgeek.net/ |
|
|
|
|
|