1

I have a list of sql files executing thru SQLCMD in batch file.

The batch file (.bat) file contains below sample script:

SQLCMD -i master.sql 

master.sql contains

:r script1.sql
:r script2.sql

If any error occurs in script1, I need to proceed with script2 but it stops at script1 with an error msg. How can I resolve this?

Mat
  • 202,337
  • 40
  • 393
  • 406
gugan
  • 11
  • 1
  • possible duplicate of [Batch Files - Error Handling](http://stackoverflow.com/questions/1164049/batch-files-error-handling) and you can check the [ERRORLEVEL](http://www.robvanderwoude.com/errorlevel.php) – Luka Milani May 28 '12 at 14:58

1 Answers1

-1

Are we talking MSSQL? In that case you might want to investigate Transact ( A built in programming language ). At any rate, using any if else structure might prove to be the solution you're looking for.

Kind Regards,

D.

Digitalis
  • 570
  • 2
  • 12