Sql 2005
I created a sql job with the sql agent to run to bat files the first step runs a bat file that imports some data into an access db from excel
that works just fine. The second/last step executes another bat file that is to create a folder that is named after the date and move the imported files into an archive folder
here is the contents of my second bat file i checked the history and the log but they did not provide any relevent info
if i run the bat file in windows by it self it works fine.
FOR /F "TOKENS=2-4 DELIMS=/ " %%a IN ("%date%") DO SET dd=%%a&SET mm=%%b&SET yy=%%c
MD D:\DB\pcorfiles\archive\"%yy%-%mm%-%dd%"
move *.xls D:\DB\pcorfiles\archive\"%yy%-%mm%-%dd%"
I tried combining my two bat files also it worked in windows but not in the job.
Help is appreciated thanks
I created a sql job with the sql agent to run to bat files the first step runs a bat file that imports some data into an access db from excel
that works just fine. The second/last step executes another bat file that is to create a folder that is named after the date and move the imported files into an archive folder
here is the contents of my second bat file i checked the history and the log but they did not provide any relevent info
if i run the bat file in windows by it self it works fine.
FOR /F "TOKENS=2-4 DELIMS=/ " %%a IN ("%date%") DO SET dd=%%a&SET mm=%%b&SET yy=%%c
MD D:\DB\pcorfiles\archive\"%yy%-%mm%-%dd%"
move *.xls D:\DB\pcorfiles\archive\"%yy%-%mm%-%dd%"
I tried combining my two bat files also it worked in windows but not in the job.
Help is appreciated thanks