I have to do this in SQL Server
I have data such as
Belo Horizonte , MG - Brazil
São Paulo , SP - Brazil
Barueri , SP - Brazil
Ferraz de Vasconcelos
Collation matters. You need to add Collate
to your query, such as:
Select * from table where exists (Select SUBSTRING(ADDRESS_BLOCK,PatIndex('% [A-Z][A-Z] %',ADDRESS_BLOCK),3) from table)
COLLATE Latin1_General_CS_AS_KS_WS ASC;
You may need a difference collation - your current one is clearly case insensitive. You can find you current collation, and replace Latin1_General_CS_AS_KS_WS
with the one you need, replacing the CI
with CS
, to get the case senstive version of your current collation.
See: http://msdn.microsoft.com/en-us/library/ms184391.aspx