Is there a good reason I see VARCHAR(255) used so often (as opposed to another length)?

后端 未结 10 640
Happy的楠姐
Happy的楠姐 2020-12-12 10:38

In multiple courses, books, and jobs, I have seen text fields defined as VARCHAR(255) as kind of the default for \"shortish\" text. Is there any good reason that a length o

10条回答
  •  粉色の甜心
    2020-12-12 11:17

    Probably because both SQL Server and Sybase (to name two I am familiar with) used to have a 255 character maximum in the number of characters in a VARCHAR column. For SQL Server, this changed in version 7 in 1996/1997 or so... but old habits sometimes die hard.

提交回复
热议问题