Now for my thesis project i need to make a lot of queries like the below

select * from tblMyTable where ItemName like '%item%'

Now my question : is that possible to create indexes for such queries ? If so what is the way of doing it ? Thank you.


For LIKE queries this is not available.

But for making such queries SQL Server provides functionality called Full-text search. More info in MSDN.

|improve this answer|||||
  • So when i set full-text search will i be able to still use the query above ? Or i need different format ? – MonsterMMORPG Feb 21 '12 at 14:02
  • You will need a different format and you will need to use Filltext-specific functions to achieve needed result. Also result will be language-specific to your database. Please refer to MSDN: Querying SQL Server Using Full-Text Search for further information. I do understand that might be not what you're looking for but that's the best SQL Server can offer for handling such needs. – Sergey Kudriavtsev Feb 21 '12 at 15:21

index will work if you have something like

where ItemName like 'item%'

also contains works much faster than like, see this: http://www.docstoc.com/docs/2280727/Microsoft-SQL-Server-70-Full-Text-Search-What-is-full-text-search

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.