Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.databases.ms-sqlserver > #654

Re: UTF-8 in MSSQL

From Erland Sommarskog <esquel@sommarskog.se>
Newsgroups comp.databases.ms-sqlserver
Subject Re: UTF-8 in MSSQL
Date 2011-09-08 23:00 +0200
Organization Erland Sommarskog
Message-ID <Xns9F5AEA1563397Yazorman@127.0.0.1> (permalink)
References <9cs5hfF6q1U1@mid.dfncis.de>

Show all headers | View raw


Keith Sauvant (oecher7.z.ksau@spamgourmet.com) writes:
> processing unicode data in MSSQL seems to require prefixing of all 
> constants in queries by a "N". That is not fun when it comes to unicode 
> enabling of big applications...

In T-SQL all literals are typed, and string literals delimited by ''
are varchar. To get an nvarchar literal, you need N''.

This is not unique to T-SQL; in C++ "" refers to a char[] literal, and to
get a wchar literal you need L"".

As for UTF-8, SQL Server does not support UTF-8 per se; the internal
storage format is UCS-2, and this is also used on the wire. However, a
good client API should hide this fact from you. 


-- 
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Links for SQL Server Books Online:
SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx

Back to comp.databases.ms-sqlserver | Previous | NextPrevious in thread | Find similar


Thread

UTF-8 in MSSQL Keith Sauvant <oecher7.z.ksau@spamgourmet.com> - 2011-09-08 17:33 +0200
  Re: UTF-8 in MSSQL Erland Sommarskog <esquel@sommarskog.se> - 2011-09-08 23:00 +0200

csiph-web