all groups > sql server dts > june 2004 >
You're in the

sql server dts

group:

passing variables into Activex Script


passing variables into Activex Script Prudhvi Reddy
6/14/2004 3:06:36 PM
sql server dts: 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


RE: passing variables into Activex Script Nigel Rivett
6/14/2004 3:54:01 PM
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 task.
http://www.nigelrivett.net/SetDTSRunTimeValues.html


[quoted text, click to view]
Re: passing variables into Activex Script Allan Mitchell
6/15/2004 6:13:28 AM
/A on DTSRUN

--
--

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org


[quoted text, click to view]
dtsrun?) then you can access this in an activex script or dynamic properties
task.
[quoted text, click to view]

AddThis Social Bookmark Button