I'm in the process of reworking some SSIS packages I inherited. A lot of these use Execute SQL Statement components to update certain fields in the tables once they've been loaded. I'd like to replace these individual UPDATE statements with Derived Column components.
I've got 95% of them converted, except for a couple, one of which has me a bit perplexed and was hoping someone could provide some insight.
Essentially, there is a column called POSTPERIOD which is a date in string format YYYYMM (i.e., 201503). The SQL update parses out the month piece and converts it to the month name and populates a column called POSTPERIOD_MONTH.
Here is the SQL:
select DateName(month , DateAdd(month, CONVERT(INT, SUBSTRING(POST_PERIOD,5,2)), 0 ) - 1 )
I'd like to accomplish this using a Derived Column, but not sure how to go about doing this...
If someone could point me in the right direction, it would be greatly appreciated!
Thanks!
A. M. Robinson