Today, we will dive into some more theoretical stuff. The topic of this article will be field lengths of database fields for addresses. For every second database I create, I am faced with the same problem: How long / “big” do I actually make the database fields for addresses? So fields, such as first name, surname, street, e-mail address, etc.
So far I have oriented myself to given requirements or old databases. But now I wanted to work up the topic once for all right. So the question is: Is there actually a standard for address field lengths?
Looking for standards for address field lengths
A search for “address field lengths for databases” spits a huge amount of hits. Unfortunately there are only opinions and experiences everywhere. Thus on wikibooks different lengths are indicated than in relevant forums. And in literature each author also gives a different recommendation. After some research, I then came across the Government Data Standards Catalog, which originates from the UK e-Government Interoperability Framework (e-GIF).
Since this document, however, is on the one hand already somewhat older and on the other hand does not take into consideration any existing German features, I have searched for another source. So at the end I have inspected the SAP standard tables ADRC, T005T, ADR06 and LFA1, because I assumed that their huge number of customers gave them a sufficient experience, to do the dimensioning of the standard table fields in a correct manner. The table below shows the values which I have taken from the two sources.
E-GIF | SAP (ADRC, T005T, ADR06) | SAP (LFA1) | |
Forename | 35 | 40 | 1-2 rows á 35 |
Surname | 35 | 40 | 1-2 rows á 35 |
Street | 2-5 rows á 35 | 60 | 35 |
Housenumber | 10 | ||
Zip-Code | 10 | 10 | |
City | 40 | 35 | |
Country | 50 | 3 (as key) | |
E-mail address | 255 | 241 | n/a |
Phonenumber | 12 | (30+10) | 16 |
As the table shows, SAP is slightly more generous (and at the same time incosequent) with field lengths. The “truth” will probably be somewhere in between. Since I didn’t find a “correct” / official standard or norm this time again, I will orient myself for the next project at the values from the above table.
If you know an official standard, I would be glad if you would leave the name or a link in the comments.
Ha! Standard lengths for database address fields? We might as well be searching for the Philosopher’s Stone! ;-)