Solved

SQL Query not returning records for UTF-8 Character

Posted on 2015-02-13
5
133 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 68

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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Select2 jquery help 9 45
combine an MS SQL string in Idera DM 9 31
shrink datafile Sql server 4 14
SQL JOIN + SUBQUERY? 3 6
Read about achieving the basic levels of HRIS security in the workplace.
Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.
Viewers will learn how the fundamental information of how to create a table.

706 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now