Searching on characters with diacritics in SQL

This forum allows users to post and respond to "How Do I Do ....." questions. The information contained in this forum has not been validated by K-Rise Systems and, as such, K-Rise Systems cannot guarantee the accuracy of the information.
smoady
Posts: 23
Joined: February 4th, 2022, 3:52 pm
Contact:

Searching on characters with diacritics in SQL

Unread post 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
word count: 99

Tags:
Post Reply