I have database with table 'Product', column 'Name'. I need to implement case and accent insensitive search so I tried to change collation of the column like this:
EXEC sp_fulltext_column @tabname = 'Product' , @colname = 'Name', @action = 'drop'
ALTER TABLE dbo.Product
ALTER COLUMN Name nvarchar(400) COLLATE SQL_Latin1_General_CP1_CI_AI NOT NULL;
EXEC sp_fulltext_column @tabname = 'Product' , @colname = 'Name', @action = 'add'
Then I checked the collation of the column like this:
SELECT collation_name FROM sys.columns
WHERE name = 'name' AND object_id = (select object_id from sys.tables where name = 'Product');
And collation is set correctly to CI and AI (SQL_Latin1_General_CP1_CI_AI).
I have test products in database with names like 'Čučoriedka', 'Čúčo', 'Test'. I would like to be able select 'Čučoriedka' and 'Čúčo' by query:
select * from product where CONTAINS([Name], 'cuc')
But neither 'test' is working with this queries:
select * from product where CONTAINS([Name], 'tes')
select * from product where PATINDEX('tes', [Name] COLLATE SQL_Latin1_General_CP1_CI_AI ) > 0
I tried also another collations, but nothing works.
Do you have any idea what can help here?
Thanks a lot! Marek