• Great. If you did need to pursue the CASE statements, you can't use "= LIKE." So you'd have to change

    AND lc.locstring =

    to

    AND lc.locstring LIKE

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning