SSIS Substring, Findstring, and trying to separate a full name column into
two columns
I have a Derived Column task set up in SSIS to split a FullName column
into FirstName and LastName columns. The data comes in from a flat file
(delimited text file, separated by commas) and looks like this:
|FullName|
|Lastname, Firstname Middlename|
Here is how I am trying to get the data to show up IMPORTANT NOTE - Not
all records have a middle name:
|FirstName|LastName|
|Firstname M|Lastname|
The LastName column was easy to populate using Substring and Findstring
appropriately. My issue now is pulling in the the first name and first
letter of the middle name into the FirstName column. I wrote this:
SUBSTRING(Name, (FINDSTRING(FullName, ",", 1) + 1), (FINDSTRING(FullName,
",", 1) + 1))
No comments:
Post a Comment