Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Size Used for Decimal Field. 1

Status
Not open for further replies.

grnzbra

Programmer
Mar 12, 2002
1,273
US
If I have some fields for US addresses (ie. state abbreviations are always 2 characters) and set the State field as CHAR(10), each record has 8 wasted characters in the State field. If, however, the State field is set as VARCHAR(10), only the 2 necessary characters will be used and there will not be 8 wasted characters in each record. (Yes, I know that the State field should be set at CHAR(2). This is just setting up for my question.)

If I have a decimal field set for (10,2) but most of the time have 3 or 4 digit integers going into it, does it behave like a CHAR field and waste the extra space, or does it behave like a VARCHAR and use only the space necessary?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top