Solved

SQL Query not returning records for UTF-8 Character

Posted on 2015-02-13
5
148 Views
Last Modified: 2015-02-14
Hello there,

I have this query with WHERE clause which when I run in mssql studio 2008 does not return any record for utf-8 character. Any idea what is wrong.

cheers
Zolf

SELECT
        count(dbo.county.id) 
    FROM
        dbo.county 
    LEFT OUTER JOIN
        dbo.province 
            ON (
                dbo.county.provinceID = dbo.province.id
            ) 
    LEFT OUTER JOIN
        dbo.district 
            ON (
                dbo.county.id = dbo.district.countyID
            ) 
    LEFT OUTER JOIN
        dbo.city 
            ON (
                dbo.district.id = dbo.city.districtID
            ) 
    LEFT OUTER JOIN
        dbo.zone 
            ON (
                dbo.city.id = dbo.zone.cityId
            ) 
    LEFT OUTER JOIN
        dbo.neighbourhood 
            ON (
                dbo.zone.id = dbo.neighbourhood.zoneId
            ) 
    LEFT OUTER JOIN
        dbo.customer 
            ON (
                dbo.neighbourhood.id = dbo.customer.neighbourhoodId
            )  
    where
        dbo.province.capital like '%ی%'

Open in new window

0
Comment
Question by:zolf
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
5 Comments
 
LVL 34

Accepted Solution

by:
Mike Eghtebas earned 500 total points
ID: 40609442
try:

 where
        dbo.province.capital like '%' + 'ی' + '%'

or

 where
        dbo.province.capital like '%' + N'ی' + '%'
0
 

Author Closing Comment

by:zolf
ID: 40609449
cheers!!
0
 
LVL 34

Expert Comment

by:Mike Eghtebas
ID: 40609451
I guess you used this one, correct?

dbo.province.capital like '%' + N'ی' + '%'
0
 
LVL 69

Expert Comment

by:Qlemo
ID: 40609631
dbo.province.capital like N'%ی%'
should work also.
0
 
LVL 34

Expert Comment

by:Mike Eghtebas
ID: 40609753
Thanks.
0

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Many companies are looking to get out of the datacenter business and to services like Microsoft Azure to provide Infrastructure as a Service (IaaS) solutions for legacy client server workloads, rather than continuing to make capital investments in h…
When table data gets too large to manage or queries take too long to execute the solution is often to buy bigger hardware or assign more CPUs and memory resources to the machine to solve the problem. However, the best, cheapest and most effective so…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Via a live example, show how to shrink a transaction log file down to a reasonable size.

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question