Friday, January 19, 2007

SSIS v9.x:How To Pass Parameters At Runtime in dtexec

HOW TO SET VALUE AT RUNTIME
===================================

1/
Create a simple package having such data flow.

2/
Create a package level variable staying in package explorer tab as follows

3/
Set that varaible as your connection string for the source flat file as follows:



4/
Create configuration file from SSIS-->Package Configurations-->Add-->Etc-->Etc.
It will make a xml file.
5/
Run it from command prompt.
dtexec -f Flat2DB_configAtRunTime.dtsx
This time it will get that there is a parameter which bears the value for the sorce file`s connection string and after searching through the config file in the same directory as the package it will get the value of that parameter at runtime from the element named "ConfiguredValue".
Now wat if we want to pass the value at run time?Yes,that can be done also.To do so first change the config file`s "ConfiguredValue" to some unknown value so that you can be sure that what value you are tio pass at runtime works.And then run at command prompt.
dtexec -f Flat2DB_configAtRunTime.dtsx /Set \Package.Variables[User::MyVar].Properties[Value];"C:\Documents and Settings\Hasim\My Documents\TEST\SSIS\emp1.txt"
---: I am not responsible for any damages happened from the suggestion of my blog :---
Reach me at : m.a.hasim@inbox.com

Labels:

0 Comments:

Post a Comment

<< Home