Hi,
I am new to SQL stored procedures and have been having fun with Error handling
. I have found a method that I am happy with, however it does not seem to handle Fatal Errors.
If I have 2 SP, say Tier1 and Tier2.
Tier1 calls Tier2 and within tier2 there is a typo that references a table that does not exist then Tier2 bombs and does not hit the SET @intError = @@Error code after the SELECT. Because the @@Error code is bypassed Tier1 will continue to process as if Tier2 succeeded.
How do I trap this fatal error in Tier1, or stop it bombing out in Tier2.
Thanks,
Hammy.
I am new to SQL stored procedures and have been having fun with Error handling
If I have 2 SP, say Tier1 and Tier2.
Tier1 calls Tier2 and within tier2 there is a typo that references a table that does not exist then Tier2 bombs and does not hit the SET @intError = @@Error code after the SELECT. Because the @@Error code is bypassed Tier1 will continue to process as if Tier2 succeeded.
How do I trap this fatal error in Tier1, or stop it bombing out in Tier2.
Thanks,
Hammy.