@echo off SET Schema=%1 SET ServerIP=%2 SET ServerPort=%3 SET UserID=%4 SET Passwd=%5 SET DBName=%6 SET SqlCmdOption=-C -U %UserID% -P %Passwd% -S %ServerIP%,%ServerPort% -f 65001 -o .\logs\%DBName%.log SET DatabaseName=%DBName% sqlcmd %SqlCmdOption% -i .\%Schema%_Create.sql if errorlevel 1 goto errexit goto end :errexit echo DB Patch Fail goto end :end @echo on