I have a database table with multiple columns; most of them are columns of type VARCHAR(x) , and some of these columns have an index for them so that I can quickly search for data inside it.
However, one of the columns is the TEXT column, because it contains a very large amount of data (23 kb plain text ascii, etc.). I want to be able to search in this column (... WHERE col1 LIKE '%search string%'... ), but currently it accepts query execution forever. I know that the query is slow because of this column search, because when I remove these criteria from the WHERE , the query ends (which I will consider) instantly.
I cannot add an index to this column because this option is grayed out for this column in the index builder / wizard in SQL Server Management Studio.
What are my options here to speed up the search for queries in this column?
Thank you for your time...
Update
So, I looked at the full text search and did all this, and now I would like to run queries. However, when using "contains", it takes only one word; what if i need the exact phrase? ... WHERE CONTAINS (col1, 'search phrase') ... throws an error.
Sorry I'm new to SQL Server
Update 2 sorry, just figured it out; use multiple "contains" sentences instead of a single sentence with multiple words. In fact, it still doesnβt work out what I want (exact phrase), it only ensures that all the words in the phrase are present.
sql-server indexing
user85116
source share