You are here: Re: Escaping international (unicode) characters in string « MsSQL Server « IT news, forums, messages
Re: Escaping international (unicode) characters in string

Posted by Erland Sommarskog on 05/29/07 13:39

Greg R. Broderick (usenet200705@blackholio.dyndns.org) writes:
> I am needing some way, in the SQL Server dialect of SQL, to escape unicode
> code points that are embedded within an nvarchar string in a SQL script,
> e.g. in Java I can do:
>
> String str = "This is a\u1245 test.";

SELECT @str = 'This is a' + nchar(1245) + ' test'

Note here that 1245 is decimal. If you want to use hex code (which you
normally do with Unicode), you would do:

SELECT @str = 'This is a' + nchar(0x1245) + ' test'




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

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация