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 |
|
vooose
Starting Member
10 Posts |
Posted - 2004-10-06 : 22:21:01
|
| @@ERROR is not 'passed up' to the calling stored procedure, so that if any error occurs and we inspect @@ERROR we don't get a value <> 0I'm wondering if there is a magical setting somewhere that automatically rollbacks everything done since the top level stored procedure was called?Wal |
|
|
derrickleggett
Pointy Haired Yak DBA
4184 Posts |
Posted - 2004-10-06 : 23:55:14
|
You have to use RETURN values. If the proc is successful RETURN 0, else RETURN 1. In the master procedure, you can:CREATE PROCEDURE test_return ASRETURN 0GODECLARE @result INTEXEC @result = test_returnSELECT @result You can then use the @result to do error handling in the top levels. This will still not trap any errors above level 16. These actually blow out of the transaction. The only way to handle these is with an application. SQL Server 2005 is changing that.MeanOldDBAderrickleggett@hotmail.comWhen life gives you a lemon, fire the DBA. |
 |
|
|
|
|
|