views:

36

answers:

1

Hi,

I'm having a problem with non-ASCII characters in a where clause

Say for example a record in my table has :

column_a Bom D� Street

And I want to see if this will find the record:

SELECT * FROM [tbl_test] where column_a = 'Bom D� Street'

This always returns no records.

Is there something you have to do to handle non-ASCII characters?

+3  A: 

Try this: SELECT * FROM [tbl_test] where column_a = N'Bom D� Street'

This should treat the string as unicode and support the full extended character set.

Randy Minder
Should this be handled in a stored procedure if you're using parameters of type NVARCHAR?
Adam Witko
@Adam - It certainly could be, but I wouldn't say it has to be.
Randy Minder