Batch file with for loop to run SQL SERVER DTS Package
Posted: 12 Apr 2010 01:36
I am currently trying to create a batch file which by looping through a list of files imports them into sql via a dts package using DTSRun Utility. I initially tested the batch run DTSRun utility in the batch for one text file and it ran with no problems.
I then added for loop functionality to the batch file to loop through the list of files and this is where I run into trouble.The syntax is as follows:
The batch file now does not run. Any ideas on where I may be going wrong
I then added for loop functionality to the batch file to loop through the list of files and this is where I run into trouble.The syntax is as follows:
Code: Select all
for /f "tokens=1,2,3" %%i in (C:\MyImport\Dirlist.txt)
DO
DTSRun /S "(local)" /N "MultipleFileImport" /G "{81FE4AE5-D2CC-47E6-B78C-9309CF4DDFB9}" /L "C:\Documents and Settings\eseosa\My Documents\dtslog.txt" /A "DatabaseName":"8"="ESSBASETESTDW" /A "FileName":"8"="C:\Documents and Settings\eseosa\My Documents\SQL_PRACTICE\%%i" /A "ServerName":"8"="(local)" /W "0" /E
The batch file now does not run. Any ideas on where I may be going wrong