Solved

SQL Query not returning records for UTF-8 Character

Posted on 2015-02-13
5
142 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
  • 3
5 Comments
 
LVL 33

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 33

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 33

Expert Comment

by:Mike Eghtebas
ID: 40609753
Thanks.
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Suggested Solutions

Read about achieving the basic levels of HRIS security in the workplace.
Shadow IT is coming out of the shadows as more businesses are choosing cloud-based applications. It is now a multi-cloud world for most organizations. Simultaneously, most businesses have yet to consolidate with one cloud provider or define an offic…
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.

785 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