Jag kunde inte heller hitta något bättre sätt än det @Sparky föreslog. Följande kod lägger till hans förslag:
@echo off :: this will execute the script into PROCESS.log sqlcmd -i Scripts\STEP01.sql -o PROCESS.log -S MYSERVER -E -d MYDATABASE :: this present the contents of PROCESS.log to the screen echo The result of the query was: type PROCESS.log pause CHOICE /C:YN /M "Is the result accord?" IF ERRORLEVEL 2 GOTO ENDWITHERROR IF ERRORLEVEL 1 GOTO STEP2