# Solved: Sql Server 2005 Length and Precision.



## CVDpr (Feb 23, 2005)

Hey there im a little confused, whats the difference between length and precision?

int(10) = 10 lenght or 10 precision?

if i have a column with tinyint lenght=1 and presicion=3. what this mean? How many number can i enter and how many i see in a select?

:-( Thanks.


----------



## Chicon (Jul 29, 2004)

Hi CVDpr,

It means 10 digits in decimal, therefore the size is 8 bytes ( values are ranging from -(2 ^ 63) through (2 ^ 63)-1 ).
A tinyint is one byte. (from 0 to 255).


----------



## CVDpr (Feb 23, 2005)

Chicon said:


> Hi CVDpr,
> 
> It means 10 digits in decimal, therefore the size is 8 bytes ( values are ranging from -(2 ^ 63) through (2 ^ 63)-1 ).
> A tinyint is one byte. (from 0 to 255).


did you answer my question of length/precision or did you only show me the ranges?


----------



## Chicon (Jul 29, 2004)

CVDpr said:


> did you answer my question of length/precision or did you only show me the ranges?


Sorry, in my prior post, int[10] has a 4 bytes length instead of 8 (bigint). 
( within the range from -(2 ^ 31) through (2 ^ 31)-1 )

The precision is the number of digits a number is showing :
- for 177, the precision is 3
- for 176.789, the precision is 6


----------

