<p>I have a simple webform that will allow unauthenticated users to input their information, including name. I gave the name field a limit of 50 characters to coincide with my database table where the field is <code>varchar(50)</code>, but then I started to wonder.</p>
<p>Is it more appropriate to use something like the <code>Text</code> column type or should I limit the length of the name to something reasonable?</p>
<p>I'm using SQL Server 2005, in case that matters in your response.</p>
<p><strong>EDIT:</strong> I did not see <a href="https://stackoverflow.com/questions/20958/list-of-standard-lengths-for-database-fields">this broader question</a> regarding similar issues.</p>

[{'answer_id': 30488, 'author': 'coder1', 'author_id': 3018, 'author_profile': 'https://Stackoverflow.com/users/3018', 'pm_score': 2, 'selected': False, 'text': '<p>We use 50.  </p>\n'}, {'answer_id': 30491, 'author': 'Greg Hurlman', 'author_id': 35, 'author_profile': 'https://Stackoverflow.com/users/35', 'pm_score': 3, 'selected': False, 'text': "<p>If it's full name in one field, I usually go with 128 - 64/64 for first and last in separate fields - you just never know.</p>\n"}, {'answer_id': 30493, 'author': 'pix0r', 'author_id': 72, 'author_profile': 'https://Stackoverflow.com/users/72', 'pm_score': 3, 'selected': False, 'text': '<p>I usually go with varchar(255) (255 being the maximum length of a varchar type in MySQL).</p>\n'}, {'answer_id': 30497, 'author': 'Craig', 'author_id': 2894, 'author_profile': 'https://Stackoverflow.com/users/2894', 'pm_score': 0, 'selected': False, 'text': "<p>The average first name is about 6 letters.  That leaves 43 for a last name. :)  Seems like you could probably shorten it if you like.</p>\n\n<p>The main question is how many rows do you think you will have?  I don't think varchar(50) is going to kill you until you get several million rows.</p>\n"}, {'answer_id': 30509, 'author': 'Ian Nelson', 'author_id': 2084, 'author_profile': 'https://Stackoverflow.com/users/2084', 'pm_score': 8, 'selected': True, 'text': '<p><a href="http://webarchive.nationalarchives.gov.uk/20100407120701/http://cabinetoffice.gov.uk/govtalk/schemasstandards/e-gif/datastandards.aspx" rel="noreferrer">UK Government Data Standards Catalogue</a> suggests 35 characters for each of Given Name and Family Name, or 70 characters for a single field to hold the Full Name.</p>\n'}, {'answer_id': 30523, 'author': 'Thomas Owens', 'author_id': 572, 'author_profile': 'https://Stackoverflow.com/users/572', 'pm_score': 3, 'selected': False, 'text': '<p>@Ian Nelson: I\'m wondering if others see the problem there.</p>\n\n<p>Let\'s say you have split fields. That\'s 70 characters total, 35 for first name and 35 for last name. However, if you have one field, you neglect the space that separates first and last names, short changing you by 1 character. Sure, it\'s "only" one character, but that could make the difference between someone entering their full name and someone not. Therefore, I would change that suggestion to "35 characters for each of Given Name and Family Name, or 71 characters for a single field to hold the Full Name".</p>\n'}, {'answer_id': 30525, 'author': 'ColinYounger', 'author_id': 1223, 'author_profile': 'https://Stackoverflow.com/users/1223', 'pm_score': 1, 'selected': False, 'text': "<p>Note that many <strong>cultures</strong> have 'second surnames' often called family names. For example, if you are dealing with Spanish people, they will appreciate having a family name separated from their 'surname'.</p>\n\n<p>Best bet is to define a data type for the name components, use those for a data type for the surname and tweak depending on locale.</p>\n"}, {'answer_id': 30687, 'author': 'Wedge', 'author_id': 332, 'author_profile': 'https://Stackoverflow.com/users/332', 'pm_score': 2, 'selected': False, 'text': "<p>What you're really asking is a related, but substantially different question: how often do I want to truncate names in order to fit them in the database? The answer depends both on the frequency of different lengths of names as well as the maximum lengths chosen. This concern is balanced by the concerns about resources used by the database. Considering how little overhead difference there is between different max lengths for a varchar field I'd generally err on the side of never being forced to truncate a name and make the field as large as I dared.</p>\n"}, {'answer_id': 562835, 'author': 'Community', 'author_id': -1, 'author_profile': 'https://Stackoverflow.com/users/-1', 'pm_score': 5, 'selected': False, 'text': "<p>I know I'm late on this one, but I'll add this comment anyway, as others may well come here in the future with similar questions.</p>\n\n<p>Beware of tweaking column sizes dependent on locale. For a start, it sets you up for a maintenance nightmare, leaving aside the fact that people migrate, and take their names with them. </p>\n\n<p>For example, Spanish people with those extra surnames can move to and live in an English-speaking country, and can reasonably expect their full name to be used. Russians have patronymics in addition to their surnames, some African names can be considerably longer than most European names. </p>\n\n<p>Go with making each column as wide as you can reasonably do, taking into account the potential row count. I use 40 characters each for first name, other given names and surname and have never found any problems.</p>\n"}, {'answer_id': 23513954, 'author': 'Themba Mabaso', 'author_id': 2242536, 'author_profile': 'https://Stackoverflow.com/users/2242536', 'pm_score': 0, 'selected': False, 'text': '<p>depending on who is going to be using your database, for example African names will do with varchar(20) for last name and first name separated. however it is different from nation to nation but for the sake saving your database resources and memory, separate last name and first name fields and use varchar(30) think that will work.</p>\n'}, {'answer_id': 34530012, 'author': 'Steve Cooper', 'author_id': 6722, 'author_profile': 'https://Stackoverflow.com/users/6722', 'pm_score': 3, 'selected': False, 'text': '<p>In the UK, there are a few government standards which deal successfully with the bulk of the UK population -- the Passport Office, the Driver &amp; Vehicle Licensing Agency, the Deed Poll office, and the NHS. They use different standards, obviously.</p>\n\n<p>Changing your name by Deed Poll <a href="https://deedpolloffice.com/changing-your-name/restrictions-on-names#maximum-length-name" rel="noreferrer">allows 300 characters</a>;</p>\n\n<blockquote>\n  <p>There is no legal limit on the length of your name, but we impose a limit of 300 characters (including spaces) for your full name. </p>\n</blockquote>\n\n<p>The <a href="http://www.datadictionary.nhs.uk/data_dictionary/data_field_notes/p/pat/patient_name_de.asp" rel="noreferrer">NHS uses 70 characters for patient names</a></p>\n\n<blockquote>\n  <p>PATIENT NAME<br>\n  Format/length:    max an70</p>\n</blockquote>\n\n<p>The Passport Office <a href="https://deedpolloffice.com/changing-your-name/restrictions-on-names#maximum-length-name" rel="noreferrer">allows 30+30 first/last</a> and Driving Licenses (DVLA) is 30 total.</p>\n\n<blockquote>\n  <p>Note that other organisations will have their own restrictions about what they will show on the documents they produce — for HM Passport Office the limit is 30 characters each for your forename and your surname, and for the DVLA the limit is 30 characters in total for your full name.</p>\n</blockquote>\n'}, {'answer_id': 70146627, 'author': 'Dmitry', 'author_id': 1501359, 'author_profile': 'https://Stackoverflow.com/users/1501359', 'pm_score': 2, 'selected': False, 'text': '<p>The answer may differ for a database field which is used to store the name, and for a field in a HTML form.</p>\n<p>The length of the Name filed in a HTML can be guided by UX.</p>\n<p>There is a <a href="https://www.researchgate.net/figure/First-names-and-last-names-lengths-distributions_fig1_328894441" rel="nofollow noreferrer">study</a> which shows that in Europe, cite: &quot;The median was 6.5 characters for the first names and 7.1 characters for the last names&quot;. If you look at the charts below you\'ll see that 10 characters for each, given name and family name, is enough to have optimal UX.</p>\n<p><a href="https://i.stack.imgur.com/Phncy.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Phncy.png" alt="enter image description here" /></a></p>\n<p>Also should be noted that governmental databases can\'t shorten names for obvious reasons. You probably can. They can afford extra storage. You probably not.</p>\n'}]
['https://Stackoverflow.com/questions/30485', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/106/']