Please explain SQL Server Data Types

AnjaliArora

New member
Joined
Jun 23, 2006
Messages
3
Programming Experience
Beginner
Hi friends

I am novice in the field. Please clear my few doubts!!!

1.Whats difference between 'char' and 'varchar'. Which one should be prefered when??

2. Difference between float,decimal and real??

If any one could provide me link to any tutorial or free e-book where i can get detail about assigning appro data type while designing database.

I will be really thankful to u.............
 
Char and varchar:
Character Strings

char
Fixed-length non-Unicode character data with a maximum length of 8,000 characters.
varchar
Variable-length non-Unicode data with a maximum of 8,000 characters.
text
Variable-length non-Unicode data with a maximum length of 2^31 - 1 (2,147,483,647) characters.



Float, decimal, real:
decimal and numeric

decimal
Fixed precision and scale numeric data from -10^38 +1 through 10^38 –1.
numeric
Functionally equivalent to decimal.

Approximate Numerics


float
Floating precision number data from -1.79E + 308 through 1.79E + 308.
real
Floating precision number data from -3.40E + 38 through 3.40E + 38.



These are all from the SQL Server books online, For all of the different data types just open the help file and search for Data Types Described.
 
Back
Top