- For individual users
- Instant access to solutions
- Ask your tech questions
- Start your 30-day Free Trial
Main Topics
Browse All TopicsHi.
We are trying to import fixed width text files into our sql 2005 db's using SSIS, but during the import require some conversion on fields. This worked ok with SQL2000 DTS as we were able to utilise the vbScript to do the conversions, but our migration to SQL 2005 and SSIS is giving us a headache, as we cannot find a way to replicate what we currently are doing.
The conversions we require are:
a) Date columns - format in the text file is ddmmyyyy e.g. 23062001 which is fine in SSIS. However empty/blank dates are either represented by 8 spaces or 00000000
b) Numeric columns - format is 9.2 so £123.45 is 000012345. This is ok in SSIS, but needs to be divided by 100 to get the decimal places correct
The Options we've identified so far are:
Option 1 - derived column for every column requiring conversion
As per this post http://www.experts-exchang
Option 2 - change the source data .
Not an option as due to legacy system constraints we are unable to do this.
Option 3 - staging table.
Not an effective option as due to the type of text file being imported, we already operate 2 staging table imports
Option 4 - script component
See code snippet for what we've tested so far. This works, but again we don't know how to re-use it within and for other packages.
Option 5 - use varchar fields in db and convert post import
While it can be done, this is getting around the problem and also creates more work and other issues.
Thx
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Business Accounts
Answer for Membership
by: simon_kirkPosted on 2009-10-07 at 08:19:55ID: 25516491
After a lot of google searching have finally managed to find a way round this. A lot of feedback suggests you can't do this without writing a conversion function, but this is not the case. Even though I've answered my own question, I thought others may benefit from the solution.
Method: