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)
因爲我只是想更新一個字段,我用這種方法。