Avineshkumar Tiwari
Avineshkumar Tiwari

Reputation: 89

Concatenating Firstname and lastname as Name and then ommit Firtname and LastName in SSIS

I have a problem statement as below :

From a DB source I have a table which has data related to Person. Out of which 3 columns are as Title, FirstName, LastName and I want to replace this as Name before actually putting it to the destination.

I tried using derived column but it gives me Name (ie. concatenation of Title, FirstName, LastName) and individual these columns as well.

Please suggest.

Upvotes: 4

Views: 584

Answers (2)

Hadi
Hadi

Reputation: 37313

First of all, your solution is good, even if individuals columns still appearing, it is not necessary to map them, to your destination, just ignore them.

Other method

If using an OLEDB Source select Source type as SQL Command and use the following command:

SELECT [Title] + ' ' + [FirstName] + ' ' + [LastName] AS Name, ...
FROM MyTable

If using Excel Source select Source type as SQL Command and use the following command:

 SELECT [Title] + ' ' + [FirstName] + ' ' + [LastName] AS Name
 FROM   [Sheet1$]

Upvotes: 1

Jayvee
Jayvee

Reputation: 10875

You can just ignore the original columns when mapping to destination or you can right click on the destination (or any transformation after the derive column) -> show advanced editor -> input columns and then uncheck the columns that you don't need anymore.

Upvotes: 2

Related Questions