SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Yet another way to include portability on DTS packages


Yet another way to include portability on DTS packages

Author
Message
alfreitas
alfreitas
SSC Rookie
SSC Rookie (29 reputation)SSC Rookie (29 reputation)SSC Rookie (29 reputation)SSC Rookie (29 reputation)SSC Rookie (29 reputation)SSC Rookie (29 reputation)SSC Rookie (29 reputation)SSC Rookie (29 reputation)

Group: General Forum Members
Points: 29 Visits: 25
Comments posted to this topic are about the item Yet another way to include portability on DTS packages
Anipaul
Anipaul
SSChampion
SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)

Group: General Forum Members
Points: 12615 Visits: 1407
The article is cool. But I am not clear with one thing.

Try to break the INI in two new files

Can you explain me this little bit elaborately? Why is the advantage of doing this way.


Smile



Bill Whitman
Bill Whitman
Grasshopper
Grasshopper (12 reputation)Grasshopper (12 reputation)Grasshopper (12 reputation)Grasshopper (12 reputation)Grasshopper (12 reputation)Grasshopper (12 reputation)Grasshopper (12 reputation)Grasshopper (12 reputation)

Group: General Forum Members
Points: 12 Visits: 13
You can use separate INI files that follow with the DTS package, or you can utilize global variables that are fed by the dtsrun command using the /A switch, or a combination of both. The simplest way we found is to feed the location of the INI file to the package using the /A switch, and then reprogram the Dynamic Properties objects to pick their values from there. Also, here is a more efficient snippet that handles multiple Dynamic Properties objects:

' Loop through package tasks, looking for dynamic
' properties task(s). If the task assignment uses an
' INI file, change the INI file specified to the value
' ASSIGNED IN THE "gvINIpath" GLOBAL VARIABLE.


Option Explicit

Function Main()

dim objPackage
dim objTask
dim objDynTask
dim objAssignment

set objPackage = DTSGlobalVariables.Parent

for each objTask in objPackage.Tasks
if objTask.CustomTaskID = "DTSDynamicPropertiesTask" then
set objDynTask = objTask.CustomTask
for each objAssignment in objDynTask.Assignments
if objAssignment.SourceType = 0 then 'Zero is INI file type
objAssignment.SourceIniFileFilename = DTSGlobalVariables("gvINIpath").Value
end if
next
end if
next

set objPackage = Nothing
set objTask = Nothing
set objDynTask = Nothing
set objAssignment = Nothing

Main = DTSTaskExecResult_Success

End Function

Code is compliments of Chris Brannigan
taulpall
taulpall
Valued Member
Valued Member (59 reputation)Valued Member (59 reputation)Valued Member (59 reputation)Valued Member (59 reputation)Valued Member (59 reputation)Valued Member (59 reputation)Valued Member (59 reputation)Valued Member (59 reputation)

Group: General Forum Members
Points: 59 Visits: 27
This is good information. I wish I would have known about this technique before having hardcode the DTS packages that I use now.

Are there any particular, known issues with converting INI enabled DTS packages to SSIS packages in SQL 2005 and/or 2008?
Bill Whitman
Bill Whitman
Grasshopper
Grasshopper (12 reputation)Grasshopper (12 reputation)Grasshopper (12 reputation)Grasshopper (12 reputation)Grasshopper (12 reputation)Grasshopper (12 reputation)Grasshopper (12 reputation)Grasshopper (12 reputation)

Group: General Forum Members
Points: 12 Visits: 13
taulpall,

Unfortunately, there "ain't no way", easily. The simplistic DTS package will convert, but I haven't seen but a handful that would -- most take advantage of activex and other obscure features of DTS that will not convert. There may be some 3rd party tools out there (there's surely a market!) but I haven't found one. I would welcome a correction on this because there are hundreds of installations of DTS that could use it. Time to get some SSIS training!
taulpall
taulpall
Valued Member
Valued Member (59 reputation)Valued Member (59 reputation)Valued Member (59 reputation)Valued Member (59 reputation)Valued Member (59 reputation)Valued Member (59 reputation)Valued Member (59 reputation)Valued Member (59 reputation)

Group: General Forum Members
Points: 59 Visits: 27
I will certainly be keen to uncover the softcoding (INI like configuration) capabilities as I experiment with SSIS.Smile
Alexander-449406
Alexander-449406
SSC Rookie
SSC Rookie (33 reputation)SSC Rookie (33 reputation)SSC Rookie (33 reputation)SSC Rookie (33 reputation)SSC Rookie (33 reputation)SSC Rookie (33 reputation)SSC Rookie (33 reputation)SSC Rookie (33 reputation)

Group: General Forum Members
Points: 33 Visits: 198
This is something that I prefer to implement using an environment variable, or actually reading the environment variable COMPUTERNAME, the good thing with SSIS is that you won't have to code this we will be using Expressions to solve this problem in SSIS...
alfreitas
alfreitas
SSC Rookie
SSC Rookie (29 reputation)SSC Rookie (29 reputation)SSC Rookie (29 reputation)SSC Rookie (29 reputation)SSC Rookie (29 reputation)SSC Rookie (29 reputation)SSC Rookie (29 reputation)SSC Rookie (29 reputation)

Group: General Forum Members
Points: 29 Visits: 25
Anirban Paul (4/10/2008)
The article is cool. But I am not clear with one thing.

Try to break the INI in two new files

Can you explain me this little bit elaborately? Why is the advantage of doing this way.


Smile


The idea is that your DTS package uses two INIs: one with technical information (like connection parameters and paths in the file server) and another one with business rules (if necessary). If you do like this, you just need to create a new INI file with business rules when you develop a new DTS package and don't have to worry about using invalid connection parameters, for example.
Yelena Varshal
Yelena Varshal
SSChampion
SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)

Group: General Forum Members
Points: 14690 Visits: 607
This is a very good article. The ideas fully apply to 2000, 2005 and will to 2008. And also to any application development: Do not hardcode the changable stuff.
One comment: I have heard from developers that they use LocalHost in order to avoid specifying the server name if their application will work on the same server as a database server. Not a good idea if you later decide to move the application or the database to another server or to use a named instance. The configuration files will do better.


Regards,
Yelena Varshal

Anipaul
Anipaul
SSChampion
SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)

Group: General Forum Members
Points: 12615 Visits: 1407
alfreitas (4/10/2008)
Anirban Paul (4/10/2008)
The article is cool. But I am not clear with one thing.

Try to break the INI in two new files

Can you explain me this little bit elaborately? Why is the advantage of doing this way.


Smile


The idea is that your DTS package uses two INIs: one with technical information (like connection parameters and paths in the file server) and another one with business rules (if necessary). If you do like this, you just need to create a new INI file with business rules when you develop a new DTS package and don't have to worry about using invalid connection parameters, for example.


Thanks alfreitas. I got it now. Also thanks others to share their thoughts.
Smile



Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum







































































































































































SQLServerCentral


Search