A VARCHAR or variable character field is a set of
character
Character or Characters may refer to:
Arts, entertainment, and media Literature
* ''Character'' (novel), a 1936 Dutch novel by Ferdinand Bordewijk
* ''Characters'' (Theophrastus), a classical Greek set of character sketches attributed to The ...
data
In the pursuit of knowledge, data (; ) is a collection of discrete values that convey information, describing quantity, quality, fact, statistics, other basic units of meaning, or simply sequences of symbols that may be further interpreted ...
of indeterminate length. The term ''varchar'' refers to a data type of a field (or
column
A column or pillar in architecture and structural engineering is a structural element that transmits, through compression, the weight of the structure above to other structural elements below. In other words, a column is a compression member. ...
) in a
database
In computing, a database is an organized collection of data stored and accessed electronically. Small databases can be stored on a file system, while large databases are hosted on computer clusters or cloud storage. The design of databases sp ...
which can hold letters and numbers. Varchar fields can be of any size up to a limit, which varies by databases: an
Oracle 11g database has a limit of 4000 bytes, a
MySQL 5.7 database has a limit of 65,535 bytes (for the entire row) and
Microsoft SQL Server 2008 has a limit of 8000 bytes (unless varchar(max) is used, which has a maximum storage capacity of 2 gigabytes).
nvarchar
is a variation of
varchar
,
SQL Server differences of char, nchar, varchar and nvarchar data types
/ref> and which is more suitable depends on the use case
In software and systems engineering, the phrase use case is a polyseme with two senses:
# A usage scenario for a piece of software; often used in the plural to suggest situations where a piece of software may be useful.
# A potential scenario ...
.
See also
* SQL data types
References
SQL
Data types
{{database-stub