I\'m loading big data into database,
i want to know how this process going.
i use
select count(*) from table
to check how
Integer division returns an integer, the decimal part is truncated. You could divide by 20000.0
:
select ( count(*)/20000.0 ) from table
Demo
MSDN / (Divide)
If an integer dividend is divided by an integer divisor, the result is an integer that has any fractional part of the result truncated.
Select CONVERT(DECIMAL(6,4),COUNT(*)) / CONVERT(DECIMAL(6,4),20000) FROM TABLE
- Its important that you match the type explicitly because not all numbers are integers and not all decimals are the same. DECIMAL(6,4) is effectively its own data type which is not the same as DECIMAL(6,3).