HiveBrain v1.2.0
Get Started
← Back to all entries
patternsqlModerate

Whats SQL Server NVARCHAR(max) equivalent in MySQL?

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
nvarcharequivalentsqlwhatsmysqlmaxserver

Problem

Using SQL Server you just have to give the "MAX" parameter to the length of a text data type, but in MySQL there's no such a thing.

According to Ispirer:


"n" is the maximum number of characters, optional


Range: 1 ⇐ n ⇐ 21845 (65535 bytes is the maximum row size shared among all columns)

Does it mean that:

[SQL Server] "NVARCHAR(MAX)" == [MySQL]"NVARCHAR(N)"


Or do i have to say NVARCHAR(21845) as NVARCHAR(MAX) in MySQL?

Solution

According to this MySQL document the LONGTEXT datatype in MySQL is 4 Gigabytes.

http://wiki.ispirer.com/sqlways/mysql/data-types/longtext

Note that the number of characters depends on the encoding.

Context

StackExchange Database Administrators Q#98268, answer score: 11

Revisions (0)

No revisions yet.