【问题标题】:SSIS XML DTSConfig update (VS 2005)SSIS XML DTSConfig 更新(VS 2005)
【发布时间】:2011-05-11 13:55:26
【问题描述】:

我有一个带有 XML 配置 (.dtsconfig) 文件的 DTS 包,其中我有一些信息需要在每次包运行时更新。

有没有办法更新 .dts 配置文件?

谢谢

【问题讨论】:

    标签: xml configuration ssis dts


    【解决方案1】:

    好的。我还没有找到这样做的方法,所以我创建了一个脚本来更新我想要的元素。

    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)
    

    因为我只想更新一个字段,所以我使用了这种方法。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2022-05-13
      • 1970-01-01
      • 1970-01-01
      • 2023-04-07
      • 2011-11-11
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多