SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 search problem with accents
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

mike13
Posting Yak Master

Netherlands
211 Posts

Posted - 07/15/2013 :  10:01:46  Show Profile  Click to see mike13's MSN Messenger address  Reply with Quote
Hi All,


i want to search in the DB and i search for: claudio

but in the DB it is Cláudio

this is one example but there are many others, is there a way so i can search for without that accents interfering ?

thanks a lot,

Mike

James K
Flowing Fount of Yak Knowledge

3562 Posts

Posted - 07/15/2013 :  11:34:31  Show Profile  Reply with Quote
Force an accent-insensitive collation. See the example below:
CREATE TABLE #tmp(NAME NVARCHAR(32));
INSERT INTO #tmp VALUES ('Cláudio'),( 'claudio');

SELECT * FROM #tmp WHERE 
NAME COLLATE Latin1_General_CI_AI = 'claudio'

DROP TABLE #tmp;
Go to Top of Page

mike13
Posting Yak Master

Netherlands
211 Posts

Posted - 07/15/2013 :  11:47:47  Show Profile  Click to see mike13's MSN Messenger address  Reply with Quote
thanks, would this work with german and Danish etc?
Go to Top of Page

James K
Flowing Fount of Yak Knowledge

3562 Posts

Posted - 07/15/2013 :  12:14:12  Show Profile  Reply with Quote
German and Danish and other languages that use accents would/should have their collation set to an accent sensitive collation. For example SQL_Latin1_General_CP1_CI_AS. When you force the collation to accent-insensitive, it should work as in the example I posted even in those languages. However, that is an educated guess - I don't have sufficient experience with internationalization and localization in SQL Server to comment on the nuances that you might run into.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.06 seconds. Powered By: Snitz Forums 2000