Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9095733
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T23:40:45+00:00 2026-06-16T23:40:45+00:00

I have a flat file that I am importing into SQL Server 2008 using

  • 0

I have a flat file that I am importing into SQL Server 2008 using an SSIS package.

The file contains a field with a number, followed by a column with a negative sign when the preceding column value is negative.

For instance:

Price    Sign
-----    -----
9212.00 
  29.01    -
 268.00    -
 453.02

I want to load this value into a decimal column on a table.

In order to accomplish this, I am creating a derived column in my Data Flow Task. The expression for the derived column is [Sign] + [Price]. I have (using the Advanced Editor) defined the derived column as type decimal [DT_DECIMAL].

Then I’m simply loading the data (along with the derived column) into my table.

Does this sound like a good way to handle this situation? Is there another method that I should consider instead? Any ‘gotchas’ with using this method?

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T23:40:46+00:00Added an answer on June 16, 2026 at 11:40 pm

    Your approach seems to be the best option. The default data type for each column from the flat file is string. So, your [Sign] + [Price] expression is doing string concatenation. And, the data is implicitly converted to a decimal value when moved to your output column.

    One change that would improve readability is to explicitly cast the string value to a decimal. You can change your expression in the Derived Column component to this:

    (DT_DECIMAL, scale)[Sign] + [Price]
    

    where scale is a number that will match the data type for your output column.

    With this change, the output from your Derived Column component will be the decimal data type.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have simple SSIS package where I import data from flat file into SQL
I have simple SSIS package which reads data from flat file and insert into
I have a flat data file that I need to import into my SQL
I have a rather complex Flat File that I'm trying to parse using SSIS.
I have a windows mobile 5.0 application (smartphone) that contains a flat data file
I'm importing a flat file of invoices into a database using C#. I'm using
I have a txt file that I’m trying to import as flat file into
While importing data from a flat file, I noticed that some of lines have
I have a flat file that I'm trying to scrub for import into a
We have an SSIS package which reads from a DB, creates a flat file

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.