Comparing Unicode strings in SQL Server

Hi,

Does anyone know how to compare two columns in SQL Server table that contain Unicode characters.

For eg: When I run this query it works :
select * from ACC_Contact
WHERE
Title = N'¿¿¿¿'

But when I am trying to query same table by joining two tables based on columns containing unicode characters, the search fails.

This query does not work:
SELECT
     src_cont.*
FROM vw_contacts src_cont
      
      JOIN JOIN ACC_Contact stage_cont (NOLOCK) ON LEFT(LTRIM(RTRIM(ISNULL(src_cont.Title, ''))), 50) = stage_cont.Title
            AND ISNULL(src_cont.First_Name, '')            = stage_cont.FirstName
            AND ISNULL(src_cont.Last_Name, '')            = stage_cont.LastName

Can you pls tell me how to append N in front of column name, just the way we can do in the first query I mentioned.

Thanks in advance for helping.
AmitJain001Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Guy Hengel [angelIII / a3]Billing EngineerCommented:
the N'<...>  is the same as CAST('<...>' as nvarchar)
in other words: CAST( yourfield as nvarchar ) should do the job.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
AmitJain001Author Commented:
Thanks it works.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Databases

From novice to tech pro — start learning today.