I am using SQL developer and I do not have permission to schedule in developer itself. I would like to schedule queries to run using Task Scheduler but I have never created a .bat file so I am unsure what I need to do. I'd like it to create an excel file. Thanks. I tried something like this. It will put an excel file in the folder but doesn't seem to run the sql. @ECHO OFF SET SQLCMD="C:\sqldeveloper\sqldeveloper\bin\sql.exe" SET PATH="C:\Users\smith\Documents\Villella" SET SERVER="sample" SET DB="world" SET LOGIN="smith" SET PASSWORD="Junk" SET OUTPUT="C:\Users\test.xlsx"
CD %PATH%
ECHO %date% %time% > %OUTPUT%
for %%f in (*.sql) do ( %SQLCMD% -S %SERVER% -d %DB% -U %LOGIN% -P %PASSWORD% -i %%~f >> %OUTPUT% )
|