Ispirer Ispirer
 


Ispirer Home Page Ispirer SQLWays Product Page - Migration to SQL Server Request SQLWays

SQL Server Data Types - NVARCHAR

Versions: SQL Server 2008, 2005, 2000, 7.0 and 6.5

SQL Server - NVARCHAR
Syntax NVARCHAR[(n | max)]
Data Variable-length character data in Unicode (UCS-2) character set
Parameters n is the maximum number of characters, optional
Range 1 ⇐ n ⇐ 4000, if max is specified, the maximum length is 2G
Default n is 1
Padding Not right-padded with spaces to n (ANSI_PADDING option does not apply to NVARCHAR)
Trailing Spaces Not removed when the value is stored and retrieved
Empty String '' is treated as empty string, 0 characters in length
Storage Size n*2 + 2 bytes
Synonyms NATIONAL CHAR VARYING, NATIONAL CHARACTER VARYING
Standards ANSI SQL

SQL Server NVARCHAR - Equivalents in Other Databases

Database Data Type and Conversion
Oracle NVARCHAR2(n), 1 ⇐ n ⇐ 4000/charsize NCLOB, 4G
MySQL NVARCHAR(n), 1 ⇐ n ⇐ 21845 LONGTEXT, 4G
PostgreSQL VARCHAR(n), 1 ⇐ n ⇐ 1G TEXT, 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 TEXT, 2G, CLOB, 4T
HP Neoview NVARCHAR(n), 1 ⇐ n ⇐ (32708 - size of other columns)
Ingres NVARCHAR(n), 1 ⇐ n ⇐ 16000, Unicode - UTF-8 LONG NVARCHAR, 2G, Unicode - UTF-8

Related Data Types in SQL Server

Data Types
Fixed-length Character Data CHAR(n) NCHAR(n)
Variable-length Character Data VARCHAR(n)
Character Large Objects TEXT NTEXT

All Data Types


Ispirer Home Page Ispirer SQLWays Product Page - Migration to SQL Server Request SQLWays

sqlways/sql-server/data-types/nvarchar_n.txt · Last modified: March 20, 2013, 04:10:01 AM (external edit)
 
Ispirer Ispirer © 1999-2014, Ispirer Systems Ltd.
All Rights Reserved.  Privacy Statement