Why does filtering on a range match the wrong case when using a Case Sensitive collation?
问题 SQL Server Standard 64 Bit with collation SQL_Latin1_General_CP1_CS_AS Table plz : ort varchar(30) SQL_Latin1_General_CP1_CS_AS select ort, from plz where ort >= 'zürich' and ort <= 'zürichz' Selects this data: Zürich Zürich Mülligen Zürich 80 Without the z at the end of second zürich no data are selected which is ok. But why does it show data on case sensitive server? 回答1: When comparing strings, one of the first things that SQL Server does is to pad the shorter string with spaces so that