@ECHO OFF
SET PROJECT=%1
SET ENVTYPE=%2

ECHO Creating Project %PROJECT% Data...
cmd /c sqlcmd -b -i "%PROJECT%_%ENVTYPE%_DataScript.sql" -S localhost -d MyDB
IF [%ERRORLEVEL%] NEQ [0] GOTO AUTOERROR

GOTO SUCCESS

:SUCCESS
ECHO.
ECHO Script run successfully

DEL *.LOG 1>NUL 2>&1
IF "%3" EQU "Quiet" GOTO AUTOEND
GOTO END

:AUTOERROR
@echo --ERROR Inserting data into %PROJECT% MyDB DB
exit /B 1

:AUTOEND
exit /B 0
goto :EOF

:END
ECHO on %date% %time%

pause
Last modified: August 14, 2020

Author

Comments

Write a Reply or Comment