Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Normal field size if there is a such of a thing

Author  Topic 

vwilsonjr
Starting Member

45 Posts

Posted - 2005-06-25 : 23:41:15
I'm developing an application the may be used for many of clients. I'm creating a user table and was wondering if there is some kind of a standard for field sizes for example

firstname
lastname
street
Street2
City
email
phone number (I would assume 12, how about if other countries would use if?)

Thanks for any input.

Thank God for Forums.

Thrasymachus
Constraint Violating Yak Guru

483 Posts

Posted - 2005-06-26 : 15:51:43
It's your discretion. I usually use varchar or nvarchar for fields like the first six. Determine how long is the longest name you know and 10 or 20 characters.

Sean Roussy

Please backup all of your databases including master, msdb and model on a regular basis. I am tired of telling people they are screwed. The job you save may be your own.

I am available for consulting work. Just email me though the forum.
Go to Top of Page

jhermiz

3564 Posts

Posted - 2005-06-26 : 23:17:20
quote:
Originally posted by vwilsonjr

I'm developing an application the may be used for many of clients. I'm creating a user table and was wondering if there is some kind of a standard for field sizes for example

firstname
lastname
street
Street2
City
email
phone number (I would assume 12, how about if other countries would use if?)

Thanks for any input.

Thank God for Forums.



Couple things you might want to consider:

1)Is the app ever going to be customized with different languages? If so use nvarchar

2)Rather than using address information in one table, I noticed you may have street1, street2, etc etc..May be a good idea to seperate address information into another table.

-Other than that varchar should be fine, I wouldn't worry about size of a phone number too much, varchar only uses what it needs. What you want to do in your interface with phone number might be a bit more trickier (if you do use any type of validation or regular expressions here).

Jon



Keeping the web experience alive -- [url]http://www.web-impulse.com[/url]
Imperfection living for perfection --
[url]http://jhermiz.blogspot.com/[/url]
Go to Top of Page
   

- Advertisement -