I have a DTS package with a XML configuration (.dtsconfig) file where i have some information that开发者_StackOverflow needs to be updated every time the package runs.
Is there a way to update the .dtsconfiguration file?
Thanks
Ok. i haven't found a way to do this so i created a script that updated the elements i wanted.
Dim xml As Xml.XmlDocument
Dim xpathTemplate As String
Dim fname As String
xpathTemplate = "/DTSConfiguration/Configuration[@Path='\Package.Variables[User::{0}].Properties[Value]']/ConfiguredValue"
fname = "config.dtsConfig"
xml = New Xml.XmlDocument()
xml.Load(fname)
xml.SelectSingleNode(String.Format(xpathTemplate, "myElement")).InnerText = "updated!"
xml.Save(fname)
Since i just wanted to update one field i used this method.
精彩评论