If I deliberately store trailing spaces in a VARCHAR
column, how can I force SQL Server to see the data as mismatch?
SELECT \'foo\' WHERE \'bar\
I've only really got two suggestions. One would be to revisit the design that requires you to store trailing spaces - they're always a pain to deal with in SQL.
The second (given your SARG-able comments) would be to add acomputed column to the table that stores the length, and add this column to appropriate indexes. That way, at least, the length comparison should be SARG-able.