Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Searching foreign characters in MS SQL DB with ASP Classic

Posted on 2012-03-10
4
Medium Priority
?
363 Views
Last Modified: 2012-03-13
Hello,

I a wondering if there is a way to search for foreign characters in a DB, so for example if someone is searching for Côte d'Azur, but a user with an English keyboard may type in Cote D'Azur, is there a simple way to query the DB by switching the foreign characters please?

Thanks!
0
Comment
Question by:Nico2011
[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
  • 2
  • 2
4 Comments
 
LVL 21

Expert Comment

by:Dale Burrell
ID: 37704781
I think by default that actually works. But assuming it doesn't you need to change the collation for the query.

Here are the possible collations: http://msdn.microsoft.com/en-us/library/ms144250.aspx

Here is how you change it for the query: http://msdn.microsoft.com/en-us/library/ms184391.aspx

You probably want Latin1_General_CI_AI which means uses the Latin1 character set CI = Case Insensitive and AI = Accent Insensitve.
0
 

Author Comment

by:Nico2011
ID: 37704857
Thanks Dale - I've read up and it sounds like that would be the solution, however when I try to update the DB, I get:

The database could not be exclusively locked to perform the operation.
ALTER DATABASE failed. The default collation of database 'nicoco_villas' cannot be set to Latin1_General_CI_AI

And I'm not sure how to lock the DB in order to perform this.. Also, am I doing the right thing?!
0
 
LVL 21

Accepted Solution

by:
Dale Burrell earned 2000 total points
ID: 37705675
Sorry I wasn't clear about that, I'm not suggesting you change the collation in the database, I'm suggesting you change it in the query. Something like:

select *
from MyTable
where MyField collate Latin1_General_CI_AI like 'Cote D'Azur'

I'm not sure I have the syntax correct, but give google a shot if not, or ask again.
0
 

Author Closing Comment

by:Nico2011
ID: 37715225
Dale - perfect - works a dream - thank you VERY MUCH!
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

In this article I will describe the Backup & Restore method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
How to leverage one TLS certificate to encrypt Microsoft SQL traffic and Remote Desktop Services, versus creating multiple tickets for the same server.
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…

609 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