• pankaja_us (7/21/2014)


    The second query

    select *

    from testdata

    where productname like searchpattern escape EscapeClause

    is returning to me just one row... I tested the whole code block in the question... care to explain

    I imagine it's because your default collation is case sensitive. As a general rule, QotD is interpreted as referring to an insttance of SQL server which is installed with every default maintained, none of the defaults oberridden by user chosen values. Every curently suported version of SQL Server (in fact not only those, but every version released from SQLS2000 on, and I believe every earlier version too although I'm not 100% certain of that) by Microsoft defaults (in every locale) on installation to case insensitive default collation, and with a case insensitive collation the second query will return 2 rows.

    Tom