0

I worked in two organizations where I found money related columns are defined as VARCHAR data type. I didn't get correct explanation from anyone. As the database team is totally isolated with our team.

Is there any specific purpose for defining the amount, account balance, money in varchar datatype?

  • 1
    No, we would only ever define money as a varchar if we were loading data to a staging table – Mark Sinkinson Nov 4 '14 at 15:08
1

We do this in our data warehouse. It's because decimal has a fixed precision and float isn't accurate past a certain number of decimal places. We need to retain the most accurate value extracted from the source as we are summing over 100 million rows and the rounding would put our figures out. However if you've got a fixed number of decimal places, then go for a decimal datatype or similar.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.