Good question. I once dug through this a little in BOL to understand all of
the data types and the differences. Since then, I use bit, small int,
varchar always unless it is a Social Security Number or 1 character, small
datetime, etc. It is important to understand how the data is stored both for
storage space reasons as well as index performance. For example. Lets say
you have a column in a table that is used for display order of the records,
and you know it will never be more than 10. Look at below what I pasted in
from BOL. Tinyint is the way to go in this case.

bigint

Integer (whole number) data from -2^63 (-9223372036854775808) through 2^63-1
(9223372036854775807).

int

Integer (whole number) data from -2^31 (-2,147,483,648) through 2^31 - 1
(2,147,483,647).

smallint

Integer data from 2^15 (-32,768) through 2^15 - 1 (32,767).

tinyint

Integer data from 0 through 255.

Dan

-----Original Message-----
From: Michael Hodgdon [mailto:[EMAIL PROTECTED]
Sent: None
To: CF-Talk
Subject: WOT: SQL Data types


I am curious how religiously people stay true to using data types for MS SQL
Server.  I know some of these stretch to other RDBMS's, however, I would
like to know what people in industry think.  What type of general rules of
thumb do people follow when planning data types  for a data store? For
instance Money, Numeric, varchar, int, bigint ...  I think you get the
point.

I am looking for response such as; never use that type, it won't convert to
Oracle.  Never use that type, the space you save is not worth it, etc....

If this needs more elaboration, please let me know

Mike.





~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/lists.cfm?link=t:4
Subscription: http://www.houseoffusion.com/lists.cfm?link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Get the mailserver that powers this list at 
http://www.coolfusion.com

Reply via email to