tags:

views:

31

answers:

0

Hi All,

I am executing a Batch Script which executes a set Of SQL Statements.The Output of a Result Set is

Name,Amount,Match    
1     10     1    
2     20     1    
3     30     0

When a Match goes to = 0, The Execution of a SQL Script should be stopped and an o/p file should be created

I am using this Command in Batch Script:

SQLCMD -S ServerName -U UserName -P Password -i "SQL Script location" -o "Output File If SQL Script Fails" 

Can anyone guide me how can I acheive this ?