Tuesday, August 29, 2006


Executing an i-sql statement via a .bat file


@echo off

if x"%1" == x"" Goto Usage
if x"%2" == x"" Goto Usage
if x"%3" == x"" Goto Usage
if x"%4" == x"" Goto Usage

isql -S %1 -d %2 -U %3 -P %4 -i create_vap_approved_applicants.sql -b
if errorlevel 10 goto error_exit
echo create_vap_approved_applicants.sql

isql -S %1 -d %2 -U %3 -P %4 -i alter_tU_CustFAA.sql -b
if errorlevel 10 goto error_exit
echo alter_tU_CustFAA.sql

goto exit

:Usage
echo Please provide the following [Servername, database, username, password].
goto exit

:error_exit
echo error found, exiting

:exit
echo done

No comments: