|  | Posted by Greg R. Broderick on 05/29/07 17:01 
Erland Sommarskog <esquel@sommarskog.se> wrote innews:Xns993F9F38ABD05Yazorman@127.0.0.1:
 
 > 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'
 
 When there are more than one or two non-US-ASCII characters in the string,
 this quickly becomes impractically unwieldy, thus my comment in my original
 posting:
 
 --- quote ---
 
 I am already aware of the UNISTR() function, and the NCHAR() function, but
 those aren't going to work well if there are more than a few international
 characters embedded within a string.
 
 --- quote ---
 
 Thanks anyway, though. :-)
 
 --
 ---------------------------------------------------------------------
 Greg R. Broderick                  usenet200705@blackholio.dyndns.org
 
 A. Top posters.
 Q. What is the most annoying thing on Usenet?
 ---------------------------------------------------------------------
  Navigation: [Reply to this message] |