×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Converting Floating point to varchar

Converting Floating point to varchar

Converting Floating point to varchar

(OP)


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.

RE: Converting Floating point to varchar

(OP)
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.

RE: Converting Floating point to varchar

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

RE: Converting Floating point to varchar

(OP)
That's actually a decent possibility.

Let me try it and see.

Thanks, MDXer.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close