Differences of CHAR and NCHAR in SQL Server Transact-SQL

Q

What Are the Differences between CHAR and NCHAR in SQL Server Transact-SQL?

✍: FYIcenter.com

A

Both CHAR and NCHAR are fixed length data types in Transact-SQL. But they have the following main differences:

  • CHAR stores characters based on the code page with 1 byte per character most of the time.
  • NCHAR stores characters using Unicode character set with 2 bytes per character most of the time.
  • CHAR(n) specifies a length of n bytes by default.
  • NCHAR(n) specifies a length of n characters by default.

 

Variables and Data Types in SQL Server Transact-SQL

⇒⇒SQL Server Transact-SQL Tutorials

2017-04-04, 171👍, 0💬