I'm having a bizarre problem in SSIS.
My package contains a Derived Column task that I use to strip off trailing blanks from the imported data. I use RTRIM(Field) to do this.
Now, I also use Excel to prep a lot of my commands. When I have a lot of fields that will be transformed, I just find it easier to use CONCATENATE to build the expression for the first field and then just copy and paste the result for the rest. Then, I C&P the results into SSIS - or, SQL, sometimes.
Anyway, when I pasted the Excel field into SSIS, the expression failed saying that it could not be parsed.
Here's what Excel gave me and what I'm pasting; RTRIM(EFF_MONTH).
I thought, well, maybe SSIS doesn't like the CR-LF that Excel adds when you copy the cell. So, I pasted the cell to Notepad first, then copied just the expression text, leaving off the CR-LF.
Again, it could not be parsed.
Since the expression looks fine, as best I can tell, I thought, well, hmm, maybe there's something else embedded in there that even Notepad is retaining. So, I hand-typed the expression.
Again, it could not be parsed.
OK, then, now I wondered if maybe, because of the earlier paste, perhaps the actual dialog to set up the transformations has become corrupted in some fashion, so I hit Cancel, and reopened the Derived Column task and manually typed in the expression.
Again, it could not be parsed.
This was becoming annoying. So, I went ahead and expanded the String Functions folder in the Derived Column Transformation Editor and dragged RTRIM to the expression field. I then expanded the Columns folder and dragged EFF_MONTH on top of the «character_expression» part of the RTRIM function in the expression field.
The result was, RTRIM([EFF_MONTH]). It added brackets to the field name and it successfully parsed.
But, says me to me, I thought the brackets were only necessary if the field name was the same as a keyword, that the brackets told the compiler that the use of the word was as a field name, and not a keyword. Further, I examined an SSIS package written by someone else and his derived columns have no brackets around the field names. His are just, RTRIM(FIELD). Why was his not giving him parsing errors?
OK, fine, it is what it is. So, I modified the Excel CONCATENATE to add brackets around the field name and C&P'd the new results.
Still, the expression turned red and would not parse.
I retyped it manually, adding the brackets.
Still failed parsing.
I drag the function and column from the top section of the Editor dialog and it works just fine, but will in no way take any sort of keyboard entry, be it manual or a C&P.
Any thoughts on why it simply will not allow me to type in the expression or to C&P it?