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 |
|
GRAYWOLF
Posting Yak Master
106 Posts |
Posted - 2009-02-12 : 03:23:04
|
| How do you tell a WHILE loop to continue if there is a certain error? I want my loop skip the file and continue if the error is "Error 530: File does not exist:"---------------------------Working until "the morning sun sets the midnight sky on fire"! |
|
|
Jai Krishna
Constraint Violating Yak Guru
333 Posts |
Posted - 2009-02-12 : 03:28:34
|
| Use IF ELSE OR CASE Statements IF(ERROR_MESSAGE()= 'File does not exist') required statementsELSErequired statementsJai Krishna |
 |
|
|
Jai Krishna
Constraint Violating Yak Guru
333 Posts |
Posted - 2009-02-12 : 03:31:41
|
| U can utilise two key words BREAK ,CONTINUE in accordance with ur problemCONTINUECauses the WHILE loop to restart, ignoring any statements after the CONTINUE keyword. BREAK Causes an exit from the innermost loop. Any statements that appear after the END keyword, marking the end of the loop, are executed. Jai Krishna |
 |
|
|
bklr
Master Smack Fu Yak Hacker
1693 Posts |
Posted - 2009-02-12 : 03:46:08
|
| try like thiswhile (cond)beginstatementsIF(ERROR_MESSAGE()= 'File does not exist')breakend--endof whileloop |
 |
|
|
|
|
|