which data type will be suitable for store these data ?

asked 2022-06-03T17:06:30.903+00:00
ahmed salah 3,126 Reputation points

I work on sql server 2017 i face issue which data type will be suitable for these data type
so are using decimal or float or which data type will be suitable for save data actually as it is

my data sample as below

MinFeatureValueNormalized
10000000
8
1
1
10000000
8
1
1
10000000
14
1
1
10000000
17
1
1
10000000
21
1
1
10000000
8
1
1
10000000
8
1
1
10000000
14
1
1
10000000
17
1
1
10000000
21

0.0000001
0.00001
0.0000001
0.00001
0.0000001
0.00001
0.0000001
0.00001
150
100
1.35
1.35
1.25
1.25
23
24
25
1.5
26
1.1
2.5
1.5
1001
1001
1001
1002
500000000
161
162
2510000000
161
162
5100000000
161
162
6100000000
SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
8,481 questions
1 vote

3 answers

Sort by: Most helpful
  1. answered 2022-06-03T17:55:27.343+00:00
    Yitzhak Khabinsky 19,851 Reputation points

  2. answered 2022-06-03T17:28:48.467+00:00
    Tom Phillips 17,511 Reputation points

    You should never use Float unless you can have some small errors in your numbers. Float is an "approximation" of a number and may not always represent exactly what you put in.


  3. answered 2022-06-03T21:36:56.957+00:00
    Erland Sommarskog 67,721 Reputation points Microsoft MVP

    I would say that it depends on what the date represents. If they are measurements from a device, float makes perfect sense. If it is financial data, less so.

    No comments