SQLWays Product Page - Migration to MySQL Free Evaluation

MySQL Data Types - NVARCHAR

Versions: MySQL 5.x, 4.x and 3.23

MySQL - NVARCHAR
Syntax NVARCHAR(n)
Data Variable-length character data in the predefined character set - UTF8
Parameters n is the maximum number of characters, optional
Range 1 ⇐ n ⇐ 21845 (65535 bytes is the maximum row size shared among all columns)
Default n is mandatory
Trailing Spaces Not removed when the value is stored and retrieved. But trailing spaces are insignificant in comparisons, primary and unique keys
Error Handling Exceeding data truncated and a warning is generated if strict SQL mode is not enabled, otherwise in case of non-space characters truncation, an error is raised
Storage Size Actual entry length
Synonyms NATIONAL VARCHAR, NATIONAL CHAR VARYING, NATIONAL CHARACTER VARYING
Standards ANSI SQL

MySQL NVARCHAR - Equivalents in Other Databases

Database Data Type and Conversion
Oracle NVARCHAR2(n), 1 ⇐ n ⇐ 4000/charsize, Unicode - UTF-8 or UTF-16
SQL Server NVARCHAR(n | max), 1 ⇐ n ⇐ 8000, 2G if max is specified, Unicode - UCS-2
PostgreSQL VARCHAR(n), 1 ⇐ n ⇐ 1G
Sybase ASE NVARCHAR(n), 1 ⇐ n ⇐ pagesize/@@ncharsize (page size is 2K, 4K, 8K or 16K); UNIVARCHAR(n), 1 ⇐ n ⇐ pagesize/@@unicharsize, Unicode
Informix NVARCHAR(n,r), 1 ⇐ n ⇐ 255, LVARCHAR(n), 1 ⇐ n ⇐ 32739
HP Neoview NVARCHAR(n), 1 ⇐ n ⇐ (32708 - size of other columns)

Related Data Types in MySQL

Data Types
Fixed-length character data CHAR(n) NCHAR(n)
Variable-length character data VARCHAR(n) TINYTEXT TEXT MEDIUMTEXT
Character large objects LONGTEXT

All Data Types

Oracle SQL Server IBM DB2 MySQL PostgreSQL Sybase ASE Sybase ASA Informix DS Teradata HP Neoview Interbase/Firebird


SQLWays Product Page - Migration to MySQL Free Evaluation

Discussion

Enter your comment:
DRPUW
 
sqlways/mysql/data-types/nvarchar_n.txt · Last modified: April 25, 2012, 04:44:53 AM (external edit)
 
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki