Is the Unicode prefix N still needed in SQL Compact Edition?

Posted by Dave on Stack Overflow See other posts from Stack Overflow or by Dave
Published on 2009-11-06T20:57:24Z Indexed on 2010/05/23 2:10 UTC
Read the original article Hit count: 290

Filed under:
|

At least in previous versions of SQL Server, you had to prefix Unicode string constants with an "N" to make them be treated as Unicode. Thus,

select foo from bar where fizz = N'buzz'

(See "Server-Side Programming with Unicode" for SQL Server 2005 "from the horse's mouth" documentation.)

We have an application that is using SQL Compact Edition and I am wondering if that is still necessary. From the testing I am doing, it appears to be unneeded. That is, the following SQL statements both behave identically in SQL CE, but the second one fails in SQL Server 2005:

select foo from bar where foo=N'???'
select foo from bar where foo='???'

(I hope I'm not swearing in some language I don't know about...)

I'm wondering if that is because all strings are treated as Unicode in SQL CE, or if perhaps the default code page is now Unicode-aware.

If anyone has seen any official documentation, either yea or nay, I'd appreciate it.

I know I could go the safe route and just add the "N"'s, but there's a lot of code that will need changed, and if I don't need to, I don't want to! Thanks for your help!

© Stack Overflow or respective owner

Related posts about unicode

Related posts about sql-server-ce