dbTalk Databases Forums  

passing variables into Activex Script

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss passing variables into Activex Script in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Prudhvi Reddy
 
Posts: n/a

Default passing variables into Activex Script - 06-14-2004 , 02:06 PM






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




Reply With Quote
  #2  
Old   
Nigel Rivett
 
Posts: n/a

Default RE: passing variables into Activex Script - 06-14-2004 , 05:54 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


"Prudhvi Reddy" wrote:

Quote:
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





Reply With Quote
  #3  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: passing variables into Activex Script - 06-15-2004 , 12:13 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


"Nigel Rivett" <NigelRivett (AT) discussions (DOT) microsoft.com> wrote

Quote:
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.
Quote:
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







Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.