Sean Lange (1/31/2014)
VoldemarG (1/31/2014)
so from everything I heard/read, would that be fair to conclude that option 2 is the way to go in the majority of cases?2) where databasename ='myDBname'
and applicationname NOT LIKE 'SQLAgent%'
and applicationname NOT LIKE ' SQL Server Log Shipping%'
and applicationname NOT LIKE 'Spotlight Diagnostic%'
If you need the wildcard then yes that would be the best way. Option 1 is nonSARGable and option 3 is not the same thing.
Note that you have a leading space on your second condition and that if you add a leading wildcard it will become nonSARGable as well. So, what's the best option? I can't give a definite answer.