Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here


Character Data-Type Field Width

Character Data-Type Field Width

Character Data-Type Field Width

I am in the process of designing a database and am having trouble deciding on the appropriate width for some of my character data-type fields.

If I am not mistaken, VFP will truncate data if the field-width is not sufficient enough to store it.  If the  field-width is greater than the number of characters needed, then it will still use the same amount of space as it would if it were populated to capacity.  Obviously, losing data isn't an option, but I don't want to use a bunch of unnecessary space either.

Does anyone have a method of choosing the appropriate field-width they can share with me?  Am I worrying about nothing?  Any help would be appreciated.



RE: Character Data-Type Field Width

The answer really depends on your situation.  If the length of the data varies widely, then you'd be better off using a memo field.  If most of the time, the data will be near a set maximum, then a character string would be the best bet.

  -BP (Barbara Peisch)

RE: Character Data-Type Field Width

To better illustrate my situation, here are some of the fields I am concered with:


While most last names aren't over, let's say 12 characters, there is bound to be an instance where the last name is more than 12 characters.  I'm fairly confident that no name would be more than 20 characters, but if I use that as the field-width then I am basically using twice as much space as I really need to for most of my data.  The same applies for the other fields.

Thanks for your help,


RE: Character Data-Type Field Width

I wouldn't worry about the extra spaces for fields like this.  I usually use 30 character fields for names, addreses, cities, etc.

  -BP (Barbara Peisch)

RE: Character Data-Type Field Width

Thanks Barbara,

I thought I might be worrying about nothing!


RE: Character Data-Type Field Width


This won't help much, but you might like to know that the next release of VFP will support variable-length character fields, in the same way that SQL Server does.

In the meantime, I'd agree with Barbara that this isn't worth worrying about. We all have names, addresses, etc in our tables, and it is not seen as a big issue.


Mike Lewis
Edinburgh, Scotland

My Visual Foxpro web site:   www.ml-consult.demon.co.uk
My Crystal Reports web site:   www.ml-crystal.com

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close