I'm new to sqlcmd and I created a batch file to process a folder of .sql files. I want to set the output up so that it only outputs to a log file and only if there is an error.
In addition, it would be nice to have a log file that would provide a way to track processing time but this is not a must have. Here is my current batch file:
For %%f IN (C:\TestScripts\*.sql) DO SQLCMD -E -S abczwq3d1 -d Test_20080901 -x -i "%%f" -b -o "%f.txt" & If errorlevel 1 GOTO end
:END
Any ideas on how to change this to provide only error log files only?
Thanks!
Teresa