November 3, 2009 at 11:07 pm
Comments posted to this topic are about the item Catching errors in DBCC CHECKDB
November 4, 2009 at 1:06 am
learnt something new.
"Keep Trying"
November 4, 2009 at 2:42 am
This was removed by the editor as SPAM
November 4, 2009 at 8:38 am
Learned something today... Good question and keep them coming.
November 4, 2009 at 9:57 am
Wouldn't the backup fail because of a corrupt table?
Gaby________________________________________________________________"In theory, theory and practice are the same. In practice, they are not." - Albert Einstein
November 4, 2009 at 3:26 pm
I actually tested the script out before I submitted it and the backup will happen. I used a corrupted database as the sample.
November 4, 2009 at 10:26 pm
IMHO, the backup will happen regardless of whether or not the CATCH block is executed (i.e. regardless of DBCC raising an error).
That is because the BACKUP command comes AFTER the END CATCH ....
What is the purpose of the TRY/CATCH block if not to avoid crashing an execution sequence?
November 4, 2009 at 10:28 pm
IMHO, the backup will happen regardless of whether or not the CATCH block is executed (i.e. regardless of DBCC raising an error).
That is because the BACKUP command comes AFTER the END CATCH ....
What is the purpose of the TRY/CATCH block if not to avoid crashing an execution sequence?
November 4, 2009 at 10:30 pm
IMHO, the backup will happen regardless of whether or not the CATCH block is executed (i.e. regardless of DBCC raising an error).
That is because the BACKUP command comes AFTER the END CATCH ....
What is the purpose of the TRY/CATCH block if not to avoid crashing an execution sequence?
November 4, 2009 at 10:43 pm
IMHO, the backup will happen regardless of whether or not the CATCH block is executed (i.e. regardless of DBCC raising an error).
That is because the BACKUP command comes AFTER the END CATCH ....
What is the purpose of the TRY/CATCH block if not to avoid crashing an execution sequence?
November 4, 2009 at 11:00 pm
IMHO, the backup will happen regardless of whether or not the CATCH block is executed (i.e. regardless of DBCC raising an error).
That is because the BACKUP command comes AFTER the END CATCH ....
What is the purpose of the TRY/CATCH block if not to avoid crashing an execution sequence?
November 5, 2009 at 2:22 am
Ol'SureHand (11/4/2009)
IMHO, the backup will happen regardless of whether or not the CATCH block is executed (i.e. regardless of DBCC raising an error).That is because the BACKUP command comes AFTER the END CATCH ....
What is the purpose of the TRY/CATCH block if not to avoid crashing an execution sequence?
There is the RETURN statement after the RAISERROR:
RAISERROR(@ErrorMessage, @ErrorSeverity, @ErrorState)
RETURN
This will interrupt the batch execution. See the link http://msdn.microsoft.com/en-us/library/ms174998.aspx:
RETURN is immediate and complete and can be used at any point to exit from a procedure, batch, or statement block. Statements that follow RETURN are not executed.
November 5, 2009 at 6:54 am
Sorry, did not even notice the "RETURN" in the CATCH block.
The eye did not see what the mind did not expect...
The solution with the "executesql" full documentation to capture the DBCC output is a useful contribution, thank you.
November 5, 2009 at 8:27 am
The DBCC will not raise an exception but only messages ("informative"), so the TRY/CATCH will not prevent anything (and so the 'return' statement will not be reach).
The Backup not fully verify integrity of database structure, just collect everything 'as it' and dump in bak file.
Which are the cases/limits/frontiers between success or fail in backup process over a corrupted db ?
edit: correct a false assert and so adjust the question 😉
November 5, 2009 at 9:11 am
Ol'SureHand (11/4/2009)
IMHO, the backup will happen regardless of whether or not the CATCH block is executed (i.e. regardless of DBCC raising an error).That is because the BACKUP command comes AFTER the END CATCH ....
What is the purpose of the TRY/CATCH block if not to avoid crashing an execution sequence?
But, why post same question for five times?
SQL DBA.
Viewing 15 posts - 1 through 15 (of 18 total)
You must be logged in to reply to this topic. Login to reply