I apologize if this has been covered ad nauseum, but I didn't see it
in my search.
Basically, in an nvarchar(150) column (called "Phrase" in the below
samples) I store both english text as well as japanese (the table is
for translations). What I'm having trouble with is querying the table
by the NVarChar field.
This works fine:
//////////////
SELECT *
FROM tbl_ShortPhrases
WHERE Phrase = 'Home'
//////////////
But when I try with japanese, nothing is returned:
/////////////
SELECT *
FROM tbl_ShortPhrases
WHERE Phrase = '$B:F2A3J(B'
/////////////
I thought that the problem might be a conversion issue, so I tried the
following with no success:
/////////////
SELECT *
FROM tbl_ShortPhrases
WHERE Phrase = CONVERT(NVARCHAR, '$B:F2A3J(B')
/////////////
Any help you can offer is appreciated!
Thanks,
Seth Rowe [MVP] 2 7068
On Tue, 15 Apr 2008 13:06:19 -0700 (PDT), rowe_newsgroups
<ro********@yahoo.comwrote:
Prefix literal unicode strings with N
For example in the AdventureWorks sample db:
select * from Person.Contact
where FirstName = N'???'
(I had used Character Map to select some Japanese character and use it
for a FirstName)
Unsure why CAST or CONVERT does not work. I would have expected the
same. Most likely following the rules of precedence your unicode is
first converted to ansi, then CONVERTed to unicode but by that time
it's too late.
-Tom.
>I apologize if this has been covered ad nauseum, but I didn't see it in my search.
Basically, in an nvarchar(150) column (called "Phrase" in the below samples) I store both english text as well as japanese (the table is for translations). What I'm having trouble with is querying the table by the NVarChar field.
This works fine:
////////////// SELECT * FROM tbl_ShortPhrases WHERE Phrase = 'Home' //////////////
But when I try with japanese, nothing is returned:
///////////// SELECT * FROM tbl_ShortPhrases WHERE Phrase = '???' /////////////
I thought that the problem might be a conversion issue, so I tried the following with no success:
///////////// SELECT * FROM tbl_ShortPhrases WHERE Phrase = CONVERT(NVARCHAR, '???') /////////////
Any help you can offer is appreciated!
Thanks,
Seth Rowe [MVP]
On Apr 15, 11:36 pm, Tom van Stiphout <no.spam.tom7...@cox.netwrote:
On Tue, 15 Apr 2008 13:06:19 -0700 (PDT), rowe_newsgroups
<rowe_em...@yahoo.comwrote:
Prefix literal unicode strings with N
For example in the AdventureWorks sample db:
select * from Person.Contact
where FirstName = N'???'
(I had used Character Map to select some Japanese character and use it
for a FirstName)
Unsure why CAST or CONVERT does not work. I would have expected the
same. Most likely following the rules of precedence your unicode is
first converted to ansi, then CONVERTed to unicode but by that time
it's too late.
-Tom.
I apologize if this has been covered ad nauseum, but I didn't see it
in my search.
Basically, in an nvarchar(150) column (called "Phrase" in the below
samples) I store both english text as well as japanese (the table is
for translations). What I'm having trouble with is querying the table
by the NVarChar field.
This works fine:
//////////////
SELECT *
FROM tbl_ShortPhrases
WHERE Phrase = 'Home'
//////////////
But when I try with japanese, nothing is returned:
/////////////
SELECT *
FROM tbl_ShortPhrases
WHERE Phrase = '???'
/////////////
I thought that the problem might be a conversion issue, so I tried the
following with no success:
/////////////
SELECT *
FROM tbl_ShortPhrases
WHERE Phrase = CONVERT(NVARCHAR, '???')
/////////////
Any help you can offer is appreciated!
Thanks,
Seth Rowe [MVP]
Ah,
Thanks Tom, it's now working just as I hoped. Amazing how one
character makes all the difference!
Thanks,
Seth Rowe [MVP] This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Tracey |
last post by:
Hi there,
I want to search Japanese characters with Full Text search function. I
created a table (tbSearch) for Full-text search on SQL 2000, English
Win2k Server. The table contains 4 fields,...
|
by: GPenn |
last post by:
SQL 2000, latest SP. We currently have the need to store data from a
UTF-8 application in multiple languages in a single database.
Our findings thus far support the fact that single-byte and...
|
by: Emilio Perez |
last post by:
Hi,
I'm trying to read a varchar(50) field writed in Japanese using this
sentence:
is = rset.getBinaryStream(num);
at that sentence the JDBC driver shows the following error:
...
|
by: Daniel |
last post by:
I'm trying to make a site work for japanese characters. It works fine
except for the alerts in javascript.
The characters are stored in unicode, as this;
'コミック全巻配'
Those unicode characters...
|
by: Indra Heckenbach |
last post by:
I have recently come across an unusual behavior with Postgres 7.3.4 on a
Linux RH 9 system. My database has encoding set to "UNICODE", and the
table includes Japanese text. I'm trying to issue a...
|
by: anony |
last post by:
Hello,
I can't figure out why my parameterized query from an ASP.NET page is
dropping "special" characters such as accented quotes & apostrophes, the
registered trademark symbol, etc. These...
|
by: bjs |
last post by:
I am using MS SQL Server 2000 and 2005, IIS 5,0 and ASP. I am able to display data that has been selected from a Unicode column in the database in all languages except Japanese (I get question...
|
by: suganya |
last post by:
I have the 2 sql tables
DoctorMaster
DRID nvarchar(50)
FirstName nvarchar(100)
LastName nvarchar(100)
Gender bit
Address1 nvarchar(255)
Address2 nvarchar(255)
|
by: leebridgewater |
last post by:
Hello Group,
I'm new to SQL sever but I have managed to create a SQL based online
application and I just have a question that I'm sure someone here will
be able to help me with.
I have a...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
| |