如何使用 SSIS 中的脚本组件创建列? [英] How I can create a column using script component in SSIS?

查看:41
本文介绍了如何使用 SSIS 中的脚本组件创建列?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下情况:我需要在 SSIS 中创建一个项目以将一些数据从 csv 导入我们的系统,但为此我必须读取一些列,其中一列是值的组".计划范围的值和这个范围可以改变每个过程,所以一些过程可能是 5 个月,而另一些过程可能是 15 个月.

I have the follow situation: I need create a project in SSIS to import some datas from csv to our system but for to do this I must read some columns, and one of this columns is "group" of values. Are values of planning horizon and this horizon can change each process, so some process can be 5 months and others 15 months.

文件 (csv) 将始终填充 21 列,但在 (22, 23...) 之后我不知道是 1、2 或更多列(水平).

The file (csv) will be filled with 21 columns always, but after (22, 23...) I don`t know if is 1, 2 or more columns (horizon).

在这种情况下,我无法从脚本转换编辑的输入和列"中创建列,我需要根据地平线长度创建列.

And with this situation I can`t create columns in "Input and Columns" from Script Transformation Edit, I need create based on lenght of horizon.

所以,当我发现地平线长度时,我的问题是否可以在运行时创建一列.

So, my question if is possible create a column in run time, when I discovery the length of horizon.

问候

推荐答案

您可以通过两种不同的方式做到这一点.

You can do this in two different ways.

  1. 向脚本组件添加列https://msdn.microsoft.com/en-us/library/ms188192.aspx

添加派生列转换并使用适当的表达式添加自定义列.

Add a derived column transformation and add a custom column with the appropriate expression.

这篇关于如何使用 SSIS 中的脚本组件创建列?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆