473,467 Members | 1,990 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

DTS Package portability

If connection properties and global variables are set from an INI
file, how can a DTS package be made truly portable?

If the INI file pathname is hard-coded in the package, it must be
edited when you copy the package to a new environment; otherwise your
packages in multiple environments will all reference the same INI
file. If there are dozens of properties that need to be set
dynamically (for example, connections that reference different text
files), changing the pathname of the INI file for each one can be a
real bear.

I was hoping to be able to set the pathname of the INI file from the
command line as a global variable. Then the package could be pointed
dynamically to one of several INI files. However, the pathname for
the INI file cannot be set dynamically from a global variable, as far
as I can tell.

One alternative would be to set connection properties and global
variables from the command line. Again, if there are dozens of
connections, the command line will be quite long!

Does anyone have any suggestions? What is the limit to command-line
length in WIN 2000?

Thanks!
Jul 20 '05 #1
2 7265
Comments inline.

Simon

"Theodore Feldman" <th**************@fmglobal.com> wrote in message
news:26**************************@posting.google.c om...
If connection properties and global variables are set from an INI
file, how can a DTS package be made truly portable?
You don't have to use an INI file - you can use other sources, including a
database query, which is often the most flexible and powerful.
If the INI file pathname is hard-coded in the package, it must be
edited when you copy the package to a new environment; otherwise your
packages in multiple environments will all reference the same INI
file. If there are dozens of properties that need to be set
dynamically (for example, connections that reference different text
files), changing the pathname of the INI file for each one can be a
real bear.
You could store these in a database table, along with some key values such
as site code, package name etc. to identify which set of values are to be
used in which "environments".
I was hoping to be able to set the pathname of the INI file from the
command line as a global variable. Then the package could be pointed
dynamically to one of several INI files. However, the pathname for
the INI file cannot be set dynamically from a global variable, as far
as I can tell.
You can just pass the server name and database name of the "configuration
database" from the command line, then retrieve the rest of the values from
the parameters table, based on whatever criteria are most useful in your
situation.
One alternative would be to set connection properties and global
variables from the command line. Again, if there are dozens of
connections, the command line will be quite long!
Probably better to pass the minimum number of values on the command line and
retrieve the rest from some other location. Using database tables makes
centralized management and logging much easier.
Does anyone have any suggestions? What is the limit to command-line
length in WIN 2000?


No idea, but as you mentioned, the command line is quite limiting. If you
really had to do this, it would probably be easier to call the DTS package
and set the variables from VB, using some sort of config file (back to INI
files again), rather than cram everything onto the command line.
Jul 20 '05 #2
takahe
1 New Member
If connection properties and global variables are set from an INI file, how can a DTS package be made truly portable?

If the INI file pathname is hard-coded in the package, it must be
edited when you copy the package to a new environment; otherwise your
packages in multiple environments will all reference the same INI
file. If there are dozens of properties that need to be set
dynamically (for example, connections that reference different text
files), changing the pathname of the INI file for each one can be a
real bear.

I was hoping to be able to set the pathname of the INI file from the
command line as a global variable.
Totally agree with the sentiment. I had a similar problem.

What I have done is to create a Dynamic Properties task which sets all of the variables that I want to populate from an ini file. In the Dyn Props task I specified a valid 'hard coded' ini file name, since as you say it cannot be entered as a parameter.

BUT, at runtime it becomes dynamic! This is achieved by creating an activex script task which is executed prior to the Dynamic properties task and whose job it is to set the actual ini file values in the Dyn Props task at run time for any assignments which are INI file based. This can then be set to a global var, environment var or whatever you want.

The text of my activex script is below
Hope it helps!



Expand|Select|Wrap|Line Numbers
  1.  
  2. '**********************************************************************
  3. '  Visual Basic ActiveX Script
  4. '************************************************************************
  5.  
  6.  
  7.  
  8. Function Main()
  9.  
  10.     '----
  11.     ' Get the MY_INI_FILE environment variable
  12.     '----
  13.  
  14.     Dim shell, env
  15.     Set shell = CreateObject("WScript.Shell")
  16.     Set env = shell.Environment("process")
  17.  
  18.     iniFileName=env("MY_INI_FILE")
  19.     '---
  20.     ' nb. we could equally have set iniFileName from a variety of places, such as
  21.     ' a global var for example, which could be passed in on the command line to dtsrun:
  22.     ' e.g. replace the above lines with:
  23.     'iniFileName= DTSGlobalVariables("MY_INI_FILE")
  24.  
  25.  
  26.     '----
  27.     ' Get the package object so that we can get a handle to our dynamic properties task
  28.     '----
  29.  
  30.     Set oPkg = DTSGlobalVariables.Parent
  31.     Set oDynProps = oPkg.Tasks("DTSTask_DTSDynamicPropertiesTask_2").CustomTask
  32.  
  33.     '----
  34.     ' iterate through the dynmic property assignments for the selected dynprops task
  35.     '----
  36.     for each oAssign in oDynProps.assignments
  37.  
  38.         if oAssign.sourceType = DTSDynamicPropertiesSourceType_IniFile then
  39.  
  40.             '----
  41.             'whenever the source type is an ini file, change the file name
  42.             '----
  43.             oAssign.SourceIniFileFileName  = iniFileName
  44.         end if
  45.     next
  46.  
  47. '----
  48. 'Return Success
  49. '----
  50.  
  51.     Main = DTSTaskExecResult_Success
  52.  
  53. End Function
  54.  
  55.  
Sep 13 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

24
by: Tim Tyler | last post by:
I just ported one of the apps I wrote using PHP 5 under Windows to PHP 4 under unix. I knew I wanted to deploy in this environment - and wrote my code in anticipation of running in the other...
3
by: Qiangning Hong | last post by:
I am writing a setup.py for my package. I have a pre-compiled myextmod.pyd file in my package and I want the distutils to automatically copy it to...
7
by: fabio de francesco | last post by:
Hi, I'm not a professional programmer, but I've been writing C/C++ and Ada programs for a few years on GNU/Linux without ever concerning on standards and portability to other OSs. I've always...
21
by: asm | last post by:
Hi All, Like typdef, does C have further support for portability? Thanks, ASM
93
by: roman ziak | last post by:
I just read couple articles on this group and it keeps amazing me how the portability is used as strong argument for language cleanliness. In my opinion, porting the program (so you just take the...
4
by: David Pratt | last post by:
Hi. I have code that currently depends on a particular package of a framework. I have decided I want to create my own package because I have made many changes and it is getting too difficult to...
93
by: jacob navia | last post by:
In this group there is a bunch of people that call themselves 'regulars' that insist in something called "portability". Portability for them means the least common denominator. Write your code...
239
by: Eigenvector | last post by:
My question is more generic, but it involves what I consider ANSI standard C and portability. I happen to be a system admin for multiple platforms and as such a lot of the applications that my...
18
by: jacob navia | last post by:
One of the holy cows here is this "portability" stuff. In practice, portability means: 1) Use the least common denominator of all the supported systems. 2) Between usability / good user...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.