Ispirer Website Ispirer Capabilities - Microsoft SQL Server Migration Free Trial

SQL Server Data Types - CHAR

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

SQL Server - CHAR
Syntax CHAR[(n)]
Data Fixed-length character data, single-byte and multibyte character sets
Parameters n is the maximum number of bytes, optional
Range 1 ⇐ n ⇐ 8000
Default n is 1
Padding Right-padded with spaces to n only if NOT NULL or ANSI_PADDING is ON
Character Set Database default, unless it is assigned using the COLLATE clause
Storage Size n bytes
Internals If defined as NULL, and SET ANSI_PADDING is OFF, it is handled as VARCHAR
Synonyms CHARACTER
Standards ANSI SQL

SQL Server CHAR - Equivalents in Other Databases

Database Data Type and Conversion
Oracle CHAR(n), 1 ⇐ n ⇐ 2000/charsize
IBM DB2 CHAR(n), 1 ⇐ n ⇐ 254
MySQL CHAR(n), 0 ⇐ n ⇐ 255
PostgreSQL CHAR(n), 1 ⇐ n ⇐ 1G
Sybase ASE CHAR(n), 1 ⇐ n ⇐ pagesize (2K, 4K, 8K or 16K)
Sybase ASA CHAR(n), 1 ⇐ n ⇐ 32767/charsize
Informix CHAR(n), 1 ⇐ n ⇐ 32767
Teradata CHAR(n), 1 ⇐ n ⇐ 64000/charsize
HP Neoview CHAR(n), 1 ⇐ n ⇐ (32708 - size of other columns)
Interbase/Firebird CHAR(n), 1 ⇐ n ⇐ 32767/charsize
Ingres CHAR(n), 1 ⇐ n ⇐ 3200

Related Data Types in SQL Server

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

All Data Types


© 1999-2024, Ispirer Systems, LLC. All Rights Reserved.