![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi I have an Activex Script which reads a file and does some transformations before importing data into SQL server. I am trying to import multiple files. I have a batch file which goes and looks through files in a certain folder. The batch file also passes the filepath of each file to the DTS package in which the Activex Script is written. I want to find how I can retirve this file path in the Activex Script???? The following is the batch file REM Export DIR listing to C:\MyImport\Dirlist.txt dir c:\MyImport\*.csv /b > C:\MyImport\Dirlist.txt REM Execute DTS package for every file name in the Dirlist.txt for /f "tokens=1,2,3" %%i in (C:\MyImport\Dirlist.txt) do "C:\Program Files\Microsoft SQL Server\80\Tools\Binn\DTSrun.exe" -F "c:\myimport\myimportdts.dts" -Uimportuser -Pimport -A"ServerName"= "SQL" -A"FileName"="c:\myimport\%%i" -A"DatabaseName"="Bank" Is here any ther way to do this. Thanks Reddy |
#3
| |||
| |||
|
|
Set the filename into a global variable when the package is loaded (/N on dtsrun?) then you can access this in an activex script or dynamic properties |
|
http://www.nigelrivett.net/SetDTSRunTimeValues.html "Prudhvi Reddy" wrote: Hi I have an Activex Script which reads a file and does some transformations before importing data into SQL server. I am trying to import multiple files. I have a batch file which goes and looks through files in a certain folder. The batch file also passes the filepath of each file to the DTS package in which the Activex Script is written. I want to find how I can retirve this file path in the Activex Script???? The following is the batch file REM Export DIR listing to C:\MyImport\Dirlist.txt dir c:\MyImport\*.csv /b > C:\MyImport\Dirlist.txt REM Execute DTS package for every file name in the Dirlist.txt for /f "tokens=1,2,3" %%i in (C:\MyImport\Dirlist.txt) do "C:\Program Files\Microsoft SQL Server\80\Tools\Binn\DTSrun.exe" -F "c:\myimport\myimportdts.dts" -Uimportuser -Pimport -A"ServerName"= "SQL" -A"FileName"="c:\myimport\%%i" -A"DatabaseName"="Bank" Is here any ther way to do this. Thanks Reddy |
![]() |
| Thread Tools | |
| Display Modes | |
| |