Solved

SQL Query not returning records for UTF-8 Character

Posted on 2015-02-13
5
153 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 70

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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
A Stored Procedure in Microsoft SQL Server is a powerful feature that it can be used to execute the Data Manipulation Language (DML) or Data Definition Language (DDL). Depending on business requirements, a single Stored Procedure can return differe…
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 extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.

728 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