@echo off & setlocal EnableDelayedExpansion
set num=0
set INSTANCE_HOSTNAME= 地址
set INSTANCE_PORT= 端口
set USER_ID= 用户名
set PASSWORD="" 密码
set SQL_PATH="" 路径
for /f "delims=""" %%i in ( 总调度文件名称 ) do (
set /a num+=1
set con!num!=%%i
call set sqlname=%%con!num!%%
echo !sqlname!
osql -S %INSTANCE_HOSTNAME%,%INSTANCE_PORT% -U %USER_ID% -P %PASSWORD% -i !sqlname!
)
pause