Wednesday, March 7, 2012

Removing formatting from imported file

I have a file I'm pulling from another type of database into an Excel spreadsheet and then using my dtsx package to import the spreadsheet into my SQL database. The problem I'm having is that one of the fields coming out of the database to the spreadsheet has the thousands seperator in the field that I want to use as a numeric field without the ",". Right now I have a macro that I run on the spreadsheet to reset the field to straight numbers without commas before importing it, but would like to configure my Integration package to do it automatically.

Any ideas would be appreciated.

Thanks in Advance

Bring the column in as a string, then use a Derived Column transform to clean it and cast it to a number.

Code Snippet

(DT_I4) (REPLACE( [YourColumn] ,",","" ) )

No comments:

Post a Comment