0
我有一个XML配置(.dtsconfig)文件的DTS包,其中我有一些信息需要在每次包运行时更新。SSIS XML DTSConfig更新(VS 2005)
有没有更新.dtsconfiguration文件的方法?
谢谢
我有一个XML配置(.dtsconfig)文件的DTS包,其中我有一些信息需要在每次包运行时更新。SSIS XML DTSConfig更新(VS 2005)
有没有更新.dtsconfiguration文件的方法?
谢谢
好的。我还没有找到办法做到这一点,所以我创建了一个脚本,更新了我想要的元素。
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)
因为我只是想更新一个字段,我用这种方法。