开发者

SSIS XML DTSConfig update (VS 2005)

开发者 https://www.devze.com 2023-03-05 15:51 出处:网络
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.

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号