简体   繁体   English

连接SSIS中的派生列

[英]Concatenate a Derived Column in SSIS

I am trying to create a derived column in my SSIS package that will concatenate some data that I have been doing manually. 我试图在我的SSIS包中创建一个派生列,该派生列将连接一些我一直在手动执行的数据。

My expression is this: 我的表情是这样的:

"FEI" + " " +  [SHIP TO WHSE] + " - " +  [SHIP TO WHSE - NAME]

I have a report that has a column labeled SHIP TO WHSE and another labeled SHIP TO WHSE - NAME . 我有一个报告,该报告的列标记为SHIP TO WHSE ,另一个标记为SHIP TO WHSE - NAME In excel I usually create a new column and add FEI to the column and then concatenate the data in another new column to create a single name for a report. 在excel中,我通常创建一个新列,并将FEI添加到该列中,然后将数据连接到另一个新列中,以为报告创建一个名称。 I would like to build this in SQL and automate its creation. 我想在SQL中构建它并使其自动化。

The above expression I thought would work to concatenate the data but it's not. 我认为上面的表达式可以用来连接数据,但事实并非如此。 The outcome should look like this. 结果应如下所示。

FEI 3112 - Sandy

Any ideas why it's not working? 任何想法为什么它不起作用?

The error message is telling me that the data types are incompatible for the " + " to work. 错误消息告诉我,数据类型与“ +”不兼容。

I just did a data conversion before the Derived column. 我只是在“派生”列之前进行了数据转换。 It was the Branch Number that was causing the issue, I converted it to match the rest and it worked. 导致问题的是分支机构编号,我将其转换为与其余版本匹配的方法,并且有效。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM