In SQL Server, the NVARCHAR(n) data type stores variable-length Unicode UCS-2 or UTF-16 character strings up to n byte-pairs with the maximum of 4,000 byte-pairs or 2 GB if NVARCHAR(max) is specified.
In MariaDB, you can use NVARCHAR(n), which can store up to 65,535 characters. However, the effective maximum length is subject to the maximum row size limit of 65,535 bytes (shared among all columns) and the character set used.
SQL Server:
CREATE TABLE specs ( item NVARCHAR(30), name NVARCHAR(100), notes NVARCHAR(MAX) );
MariaDB:
CREATE TABLE specs ( item NVARCHAR(30), name NVARCHAR(100), notes LONGTEXT ); /* Query OK */ -- NVARCHAR is implemented as VARCHAR with CHARACTER SET UTF8 SHOW CREATE TABLE specs; /* CREATE TABLE `specs` ( `item` varchar(30) CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci DEFAULT NULL, `name` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci DEFAULT NULL, `notes` longtext ) ... */
Conversion summary:
For more information, see SQL Server to MariaDB Migration.