【发布时间】:2016-09-16 12:02:04
【问题描述】:
我正在尝试根据特定键将某个值从 .config 文件插入到 SQL Server 表中。
简化的 .config 文件如下所示:
<configuration>
<appSettings>
<add key="supportingLocalReview" value="true" />
<add key="localFilingReviewServiceProxyAddress" value="http://web.myflcourtaccess.com:25500/SoapOutgoingRouter.svc/SecureMtom" />
<add key="addReceivedStamp" value="true" />
</appSettings>
<system.serviceModel>
<bindings>
<basicHttpBinding />
</bindings>
<behaviors />
<client>
<endpoint address="http://fca.com:155/RecordMDE/RecordMDE.svc" binding="basicHttpBinding" bindingConfiguration="IntranetMtom" contract="Oasis.LegalXml.CourtFiling" name="RecordMDEServiceNew" />
</client>
</system.serviceModel>
</configuration>
我的初始过程来自这个thread,我在其中创建了一个表并使用 OPENROWSET 将整个文件插入到表中:
INSERT @ConfigTable
SELECT a.* FROM OPENROWSET(BULK '\\Directory\Configuration\Broward_CMS_Interface_1.config', SINGLE_CLOB ) a
SELECT * FROM @ConfigTable;
如果是key="supportingLocalReview" value="true",我想插入到配置表中的是端点地址“http://fca.com:155/RecordMDE/RecordMDE.svc”,但我不确定如何实现。
有什么建议吗?
【问题讨论】:
标签: xml tsql config sql-server-2014