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 6352953
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T22:19:30+00:00 2026-05-24T22:19:30+00:00

What are the differences between numeric , float and decimal datatypes and which should

  • 0

What are the differences between numeric, float and decimal datatypes and which should be used in which situations?

For any kind of financial transaction (e.g. for salary field), which one is preferred and why?

  • 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-05-24T22:19:31+00:00Added an answer on May 24, 2026 at 10:19 pm

    use the float or real data types only if the precision provided by decimal (up to 38 digits) is insufficient

    • Approximate numeric data types(see table 3.3) do not store the exact values specified for many numbers; they store an extremely close approximation of the value. (Technet)

    • Avoid using float or real columns in WHERE clause search conditions, especially the = and <> operators. It is best to limit float and real columns to > or < comparisons. (Technet)

    so generally choosing Decimal as your data type is the best bet if

    • your number can fit in it. Decimal precision is 10E38[~ 38 digits]
    • smaller storage space (and maybe calculation speed) of Float is not important for you
    • exact numeric behavior is required, such as in financial applications, in operations involving rounding, or in equality checks. (Technet)

    1. Exact Numeric Data Types decimal and numeric – MSDN
    • numeric = decimal (5 to 17 bytes)
      • will map to Decimal in .NET
      • both have (18, 0) as default (precision,scale) parameters in SQL server
      • scale = maximum number of decimal digits that can be stored to the right of the decimal point.
      • money(8 byte) and smallmoney(4 byte) are also Exact Data Type and will map to Decimal in .NET and have 4 decimal points (MSDN)
    1. Approximate Numeric Data Types float and real – MSDN
    • real (4 byte)
      • will map to Single in .NET
      • The ISO synonym for real is float(24)
    • float (8 byte)
      • will map to Double in .NET

    Exact Numeric Data Types
    Approximate Numeric Data Types

    • All exact numeric types always produce the same result, regardless of which kind of processor architecture is being used or the magnitude of the numbers
    • The parameter supplied to the float data type defines the number of bits that are used to store the mantissa of the floating point number.
    • Approximate Numeric Data Type usually uses less storage and have better speed (up to 20x) and you should also consider when they got converted in .NET
    • What is the difference between Decimal, Float and Double in C#
    • Decimal vs Double Speed
    • SQL Server – .NET Data Type Mappings (From MSDN)

    main source : MCTS Self-Paced Training Kit (Exam 70-433): Microsoft® SQL Server® 2008 Database Development – Chapter 3 – Tables, Data Types, and Declarative Data Integrity Lesson 1 – Choosing Data Types (Guidelines) – Page 93

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

Sidebar

Related Questions

What are the differences between these two, and which one should I use? string
Is there any difference between DECIMAL and NUMERIC data types in SQL Server? When
What are the differences between the two? I've only used one kind of constructor
What are the key differences between these and when should they be used? My
Is there any differences between hibernate session and the session which you use while
What are the differences between a HashMap and a Hashtable in Java? Which is
What are the differences between htmlspecialchars() and htmlentities() . When should I use one
Are there any differences between what in Common Lisp you'd call an atom, and
Are there any differences between boost::shared_ptr , std::tr1::shared_ptr and the upcoming (in C++0x )
Are there any differences between add to watch and add to quick watch?

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.