Showplans for these two queries would be different. Check those out and you will get the clue. I think Optimizer is smart enough to see that the second query could take advantage of an index on the column (if such exists). For the first query, because of the LIKE clause plus a variable, it does not have enough information to create more efficient showplan.