Unicode in SQL query
-
Hi friends, I am working with SQL Server 2005 database with Collation selected as Chinese_PRC_CI_AS I have a table DMASTER in the database with a field called DNAME of type VARCHAR(254) which contains some Chinese characters. When i run a query like select * from dmaster where DNAME = N'翻译文字或网页翻译文字或网页'; from the SQL Server 2005 client, it works fine. But if I try the same query programmatically using API "SQLExecDirect", it returns no records. May I know the problem and how to solve it. Thank you
cheers Varghese Paul
-
Hi friends, I am working with SQL Server 2005 database with Collation selected as Chinese_PRC_CI_AS I have a table DMASTER in the database with a field called DNAME of type VARCHAR(254) which contains some Chinese characters. When i run a query like select * from dmaster where DNAME = N'翻译文字或网页翻译文字或网页'; from the SQL Server 2005 client, it works fine. But if I try the same query programmatically using API "SQLExecDirect", it returns no records. May I know the problem and how to solve it. Thank you
cheers Varghese Paul
Have you tried using
SQLExecDirectW
which is unicode version of the function. See: Unicode Function Arguments[^]The need to optimize rises from a bad design.My articles[^]
-
Have you tried using
SQLExecDirectW
which is unicode version of the function. See: Unicode Function Arguments[^]The need to optimize rises from a bad design.My articles[^]
Thank you. It worked fine.
cheers Varghese Paul
-
Thank you. It worked fine.
cheers Varghese Paul