Re: convert unicode to ansi
From: Ivan Arjentinski (jarj11_at_hotmail.com)
Date: 05/09/04
- Next message: web developer: "tuning the sort step of execution plan"
- Previous message: Hugo Kornelis: "Re: Summary Query Question. Please help."
- In reply to: Kyriacos Michael: "convert unicode to ansi"
- Next in thread: Kyriacos Michael: "Re: convert unicode to ansi"
- Reply: Kyriacos Michael: "Re: convert unicode to ansi"
- Messages sorted by: [ date ] [ thread ]
Date: Sun, 9 May 2004 12:43:48 +0300
Hi,
If I understand correctly you are having problem sending unicode query from
your environment. You might try using NCHAR function to create queries which
are code page insensitive.
SELECT *
FROM table1
WHERE field1=NCHAR(5050) + NCHAR(6532) ...
Research also the UNICODE function which is the reverse of NCHAR.
Regards,
Ivan
"Kyriacos Michael" <kyrmich@XXXbadfan.comXXX> wrote in message
news:OJXYqMaNEHA.268@TK2MSFTNGP11.phx.gbl...
> I am having problems using ANSI encoding to query a unicode database that
is
> storing greek.
>
> from Query Analyzer:
> create table table1 (field1 nvarchar(10))
> insert into table1 select N'psi' --where psi is some greek characters
> select * from table1 where field1='psi' -- no results which is fine
> select * from table1 where field1=N'psi' -- 1 row
>
> by using PHP queries (ANSI):
> select * from table1 where field1='psi' -- no results
> select * from table1 where field1=N'psi' -- no results
> select * from table1 where field1 collate Greek_CI_AS = 'psi' -- no
results
> select * from table1 where field1 collate Greek_CI_AS = 'psi' collate
> Greek_CI_AS -- no results
> select * from table1 where convert(varchar(10), field1 collate
Greek_CI_AS)
> = 'psi' collate Greek_CI_AS -- no results
>
> The "problem" is that php sends "psi" character as ascii(248) to sql
server.
> My questions is:
> Can can I force sql server to convert a unicode character to an ansi one
> based on a given codepage, to workaround this problem?
>
> Thanks a lot
>
>
- Next message: web developer: "tuning the sort step of execution plan"
- Previous message: Hugo Kornelis: "Re: Summary Query Question. Please help."
- In reply to: Kyriacos Michael: "convert unicode to ansi"
- Next in thread: Kyriacos Michael: "Re: convert unicode to ansi"
- Reply: Kyriacos Michael: "Re: convert unicode to ansi"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|