October 23, 2003 at 4:00 pm
Where is the Dynamic Properties Task info stored? It is not visible in Disconnected Edit, and I don't see it in any tables in MSDB.
I am using a Dynamic Properties task to read an INI file to set connection, username, password, etc. values at runtime. All well and good... BUT - I want to promote the package to an oddball new environment that does not follow the same directory naming standard. That means the INI file from where I would get the settings is not visible unless I manually edit the package, which defeats [some of] the purpose of a dynamic INI. How can I dynamically define the name/location of the INI file (initialize my INI file 🙂 )?
Yes, I can think of ways to write code to dynamically figure out the environment to then read a registry setting pointing to the correct file and then set the task properties from there, but I would rather not have to rewrite the current simple INI mapping that exists.
Thanks,
Larry
Larry
October 27, 2003 at 12:00 pm
This was removed by the editor as SPAM
October 27, 2003 at 2:09 pm
Looking at the DTS object model, the Dynamic Properties Task is exposed via a method, hence you make be able to change it using visual basic
Steven
July 29, 2004 at 12:42 pm
Try using relative addressing (such as .\dtsconfig.ini) in the File: value of the Source information section in the Add/Edit Assignment dialog for you Dynamic Properties Task. Of course, this requires your using dtsrun.exe to execute the dts package saved as a .dts file and that the .ini file reside in the same folder as the .dts file. Otherwise, if you are running dts packages from within SQL Server under Local Packages, you may be able to map a spare drive letter to a share where your .ini files exists (and specifiy the .ini location as something like w:\dtsconfig.ini) and just remap the drive letter to another share as necessary. Hope this all helps and makes sense.
August 26, 2004 at 3:45 am
Hi folks,
This was battering me a little, as I needed to change the name of the ini file, depending on the environment it was being run in. So I came up with this. This ActiveX script, run before your Dynamic Properties Task, can look through all the ini file properties, and modify the ini file location or name. It takes the file location from a global, that could be set staticly, or passed in with DTS run.
Hope it's of some use.
'********************************************************************** ' Visual Basic ActiveX Script
' August 2004, Simon Dick, Gapconsulting ' ' Modifies the location of the ini file used by the Dynamic properties task. ' Make sure you have the location set in a global, perhaps passed ' in by DTS Run? ' ' References: MSDN; artical on http://www.sqldts.com/ about changing
'properties of CreateProcess tasks through activeX scripts '************************************************************************
Function Main() dim pkg dim cus
dim ass dim ass1 ' get a reference to the package set pkg = DTSGlobalVariables.Parent
'Get reference to the task we want to modify set cus = pkg.Tasks("DTSTask_DTSDynamicPropertiesTask_1").Customtask
' get a reference to the collection of Dynamic properties assignments set ass = cus.Assignments
' loop through assignment for each ass1 in ass ' check that it's an ini file parameters If ass1.SourceType = DTSDynamicPropertiesSourceType_IniFile Then ass1.SourceIniFileFileName = DTSGlobalVariables("Ini File Name").Value End If next set ass = nothing set cus = nothing set pkg = nothing
Main = DTSTaskExecResult_Success End Function
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply