Wednesday, 27 January 2010

Wildcards in WHERE Clauses

This is just a very short post regarding the use of wildcards in a WHERE Clause

It is possible that the first WHERE clause below can use an Index seek

Where LastName like ‘[a-z]%ent’ can use an index

This second statement will not be able to use a seek and will result in a scan

WHERE LastName like ‘%ent’

No comments:

Post a Comment

Featured post

SQL Server 2008 and SQL Server 2008 R2 - OUT of SUPPORT July 2019

Both SQL Server 2008 and SQL Server 2008 R2 go out of extended support with Microsoft in July 2019. That’s fast approaching and as we enter ...