[freetds] unicode

Christos Zoulas christos at zoulas.com
Tue Jul 22 18:17:13 EDT 2008

On Jul 22,  4:01pm, jklowden at freetds.org ("James K. Lowden") wrote:
-- Subject: Re: [freetds] unicode

| Jason Young (Morgon) wrote:
| > SQL Server is a pain in regards to sending UTF strings, as you'll need=20=
| > to prefix all of your quoted strings with capital N, for example:
| > INSERT INTO utf8_table (utf8string) VALUES (N'???')
| I don't see what difference the 'N' prefix makes. =20

The N prefix makes literal strings (not parameterized ones) UCS2.

If you declare a column nstring instead of string then you should
use N'literals' (and the other way around). If you don't the server
will make an implicit conversion for you. It is very important to
get the types right, because if you don't, then the implicit
conversion will happen on each row, prohibiting the use of indexes,
and have a severe performance impact.


More information about the FreeTDS mailing list