Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <h3>What is VARCHAR(max)?</h3> <p><code>varchar(max)</code> is a feature of Microsoft SQL Server.</p> <p>The amount of data that a column could store in Microsoft SQL server versions prior to version 2005 was limited to 8KB. In order to store more than 8KB you would have had to use <code>TEXT</code>, <code>NTEXT</code>, or <code>BLOB</code> columns types, these column types stored their data as a collection of 8K pages separate from the the table data pages; they supported storing up to 2GB per row.</p> <p>The big caveat to these column types was that they usually required special functions and statements to access and modify the data (e.g. <code>READTEXT</code>, <code>WRITETEXT</code>, and <code>UPDATETEXT</code>)</p> <p>In SQL Server 2005, <code>varchar(max)</code> was introduced to unify the data and queries used to retrieve and modify data in large columns. The data for <code>varchar(max)</code> columns is stored inline with the table data pages.</p> <p>As the data in the MAX column fills an 8KB data page an overflow page is allocated and the previous page points to it forming a linked list. Unlike <code>TEXT</code>, <code>NTEXT</code>, and <code>BLOB</code> the <code>varchar(max)</code> column type supports all the same query semantics as other column types. </p> <p>So <code>varchar(MAX)</code> really means <code>varchar(AS_MUCH_AS_I_WANT_TO_STUFF_IN_HERE_JUST_KEEP_GROWING)</code> and not <code>varchar(MAX_SIZE_OF_A_COLUMN)</code>.</p> <h3>MySql does not have an equivalent idiom.</h3> <p>In order to get the same amount of storage as a <code>varchar(max)</code> in MySql you would still need to resort to a <code>BLOB</code> column type. <a href="http://www.dreamwerx.net/phpforum/?id=1" rel="noreferrer">This article</a> discusses a very effective method of storing large amounts of data in MySql efficiently.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload