You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

SSIS中Kingswaysoft JSON Source动态节点名称配置咨询

解决Kingswaysoft JSON Source动态节点名称的方案

方法1:用JSON Path表达式替代可视化节点选择

放弃Document Designer的可视化选择,切换到JSON Path模式,手动编写支持动态参数的路径:

  • 假设你的SSIS参数为@[User::CurrentIndicator],对应的JSON Path可写成$.Indicators.[''+@[User::CurrentIndicator]+''],以此根据参数值动态定位目标节点。
  • 若节点名称含特殊字符,需调整Path写法,比如用双引号包裹节点名。

方法2:预处理JSON数据(脚本组件)

如果JSON Path的动态写法受限制,可通过SSIS脚本组件先处理原始JSON:

  • 读取原始JSON字符串,将Indicators下的目标节点重命名为固定名称(比如TargetIndicator),再把处理后的JSON传给Kingswaysoft JSON Source。
  • 脚本组件中的C#示例片段:
string originalJson = Row.JsonData;
JObject jsonObj = JObject.Parse(originalJson);
string indicatorName = Variables.CurrentIndicator;
var targetNode = jsonObj["Indicators"][indicatorName];
jsonObj["Indicators"]["TargetIndicator"] = targetNode;
jsonObj["Indicators"].Remove(indicatorName);
Row.ProcessedJson = jsonObj.ToString();

之后在Document Designer中直接选择固定的TargetIndicator节点即可。

方法3:利用Kingswaysoft的动态表达式支持

部分版本的Kingswaysoft工具允许在Document Designer的节点名称输入框中直接使用SSIS变量/参数:

  • 直接输入@[User::CurrentIndicator](注意部分版本需用特定包裹符),保存后工具会自动解析变量值作为节点名称。

内容的提问来源于stack exchange,提问作者olf

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.24 11:23:12