views:

123

answers:

1

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!

A: 

SQL CE was originally developed for Windows CE, which is purely Unicode. As a result, SQL CE already leans heavily toward Unicode and the "N" prefix is unnecessary.

ctacke
I was hoping for "official" documentation, but your answer certainly sounds reasonable. Thanks for the help! And if you happen to see any "official word" from Microsoft, I'd love to see it!
Dave