I am having a query which is searching the result from the table,if a row match a specific object it will provide the result.
So,it is a 12 letter number.
So functionality is if user provided a number as 414.it will search like '%414%'.
And if the length of number exceed 6 digits it will search like '4146144%'
as a result the query is getting so much slower as we are having 20 million records.
Can you please provide me any alternative to fix that problem.
Company is not allowing to use any API or anything else.
SELECT distinct TOP (15) bt_id AS [Key]
, UPPER(rtrim(ltrim(bt_id)))+' - '+UPPER(rtrim(ltrim(bt_desc))) AS [Description]
FROM fcbillto
WHERE bt_id like '%' + @SearchTerm + '%'
OR bt_desc like '%' + @SearchTerm + '%'
If Full text scan is the solution than can i create two different catalog for a single table because above is one of the column on which i need to search and in else condition i am searching on some other column of same table.So,i need to create two repositories.