Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Converting Floating point to varchar

Status
Not open for further replies.

GrandMauler

Programmer
May 16, 2007
74
US


Here's the problem: I'm writting a simple SSIS package that reads a sheet from an Excel File and imports into a table in an SQL 2k5 database.

Some of the columns in Excel are floating point. I need to convert it to either varchar or nvarchar.

The problem is that if I do a straight import from source to destination, the result is scientific notation written in text.


I'd like the scientific notation converted to an actual decimal, then converted into text.



I realize could create an intemdiate SQL script to convert each floating point column from scientific to traditional number.

But is there an easier way?


thanks in advance.
 
I just thought of a possible solution, although I'm hoping someone here has a more a direct way of doing it.

Have the SSIS read the sheet from the Excel file and output it into a flat file... then use that flat file as the source to read into the table in the database.



Let me know what you think.
 
have you looked at the data conersion task or a derived column?


you may have to use mutiple tasks as in first convert to decimal then to varchar.

Paul
---------------------------------------
Shoot Me! Shoot Me NOW!!!
- Daffy Duck
 
That's actually a decent possibility.

Let me try it and see.

Thanks, MDXer.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top