|
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
[Back to original message]
|