Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Contains

Author  Topic 

shapper
Constraint Violating Yak Guru

450 Posts

Posted - 2011-02-05 : 10:05:43
Hello,

I am running a query with contains to search a field for a word named "Camões".

The problem is that if I use the word "Camoes", "CAMOES", CaMoes" all give me different results.

How can I make all these words the same?

And can I change it on a database using T-SQL?

Thank You,

Miguel

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2011-02-05 : 10:08:05
You can use a case insensitive collation.



N 56°04'39.26"
E 12°55'05.63"
Go to Top of Page

shapper
Constraint Violating Yak Guru

450 Posts

Posted - 2011-02-05 : 10:14:16
This is set for the entire table, correct?

Is this a good approach?
I don't see a problem in my case. Just asking.

And how can I see the current collation and change it?
Go to Top of Page

shapper
Constraint Violating Yak Guru

450 Posts

Posted - 2011-02-05 : 10:22:51
I was checking the Collation for the field I am searching using:
EXEC sp_help 'dbo.Books'

And got:
Description nvarchar Latin1_General_CI_AS

Isn't this Case Insensitive?

So shouldn't the search work for Camões, Camoes, CAMOES or CaMoes all giving the same?

Thank You,
Miguel
Go to Top of Page
   

- Advertisement -