6

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?

5

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.

  • Is Longtext better than NVARCHAR to store text as html or xml? – Jonathan Solorzano Apr 20 '15 at 2:53
  • I would not think so. But why the question? If you are using MySQL then use LONGTEXT, but if you are using MS SQL Server then use VARCHAR (MAX). I would not choose the server platform based on this issue, but would choose to stick to my current environment unless there was real reason to change. – RLF Apr 23 '15 at 13:44
0

TEXT (max of 64K bytes) or MEDIUMTEXT (max 16M bytes) is typically used. There is no 'max' after them.

VARCHAR(1111) is like NVARCHAR; the 1111 is the limit on characters (not bytes). VARCHAR is limited to 64K characters.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.