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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

varchar versus char

Status
Not open for further replies.
Jun 27, 2001
837
US
I no this is like arguing politics, but isn't there a formula for using varchar versus char? I realize there is some overhead with varchar, but if a majority of our data fields are empty(not my desing and cna't change), wouldn't the varchar be better
 
I would use VARCHAR. Somewhere I saw just exactly how much room would be used by a NULL value in CHAR and VARCHAR. I believe the CHAR uses 1 byte (default for CHAR is CHAR(1)). With VARCHAR a NULL does't have any length so it's equivlent to VARCHAR(0). Again, that's the way I remember seeing it explained.

-SQLBill
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top