Page 1 of 1

Searching on characters with diacritics in SQL

Posted: June 20th, 2024, 1:56 pm
by smoady
When trying to search on a string with special characters containing diacritics using SQL, records with special characters containing diacritics are not located. for example
As displayed in the screenshot above, we're trying to search for the exact description for a record that exists in a catalog
SearchBeforefix1.png
After attempting to search for the specified description, we don't get any records as shown in the screenshot below
SearchBeforefix2.png
To fix this, we added COLLATE Latin1_General_CI_AI to resolve the issue

For example
SELECT * FROM Item_Catalog
WHERE Description like '%Sberný systém%'
COLLATE Latin1_General_CI_AI