@echo off
setlocal
set errorlevel=0
set errorlevel=

if [%1]==[] goto INCORRECT_CALL
if "%~1"=="" goto INCORRECT_CALL
if not [%2]==[] goto INCORRECT_CALL

set ScriptFile$$=%~1

rem mode con: cols=101
rem if %errorlevel% neq 0 goto ERROR
rem color 0F
rem if %errorlevel% neq 0 goto ERROR

set $sqltrans.SkipConfirmation=1
set $sqltrans.ShowConnectionInfo=1

echo * Invoking SQL-translation utility ...
echo.
$SqlTrans "%ScriptFile$$%"
goto ERROR

rem set $sqltrans.SkipConfirmation=1
rem set $sqltrans.ShowConnectionInfo=1
rem set $sqltrans.SkipCompletionPause=1
rem call $SqlTrans.cmd "%ScriptFile$$%"
rem if %errorlevel% neq 0 goto ERROR
rem goto FINISH
::==================================================================================================
:INCORRECT_CALL
echo.
echo ## Incorrect call of "InvokeSqlTrans.cmd" (special batch).
goto ERROR
::==================================================================================================
:ERROR
echo 
pause
EXIT 255
::==================================================================================================
:FINISH
echo.
pause
EXIT
::==================================================================================================
