• Hugo Kornelis (12/1/2013)


    But [a], , and [cde] are all wildcard patterns - a search pattern that combines wildcard characters and normal characters to define the set of strings that should match.

    The question was not about wildcard patters (or, to stick to the official Microsoft terminology, "like patterns"). The question was about wildcard characters. Of which exactly four are described in Books Online: %, _, [], and [^]. See http://technet.microsoft.com/en-us/library/ms179859.aspx.

    So, [] is a character, and so is [^]? :w00t: That's quite an amazing misuse of English! Neither one is a character. One of them consists of two characters, and the other consists of three characters. Is the whole text of Gibbon's "Decline and Fall of the Roman Empire" a character? After all, if a string (or pattern, fo that matter) of two characters is a character and so is a string of three characters, it's difficult to see why a string of tvery very many characters shouldn't also be a character as well!

    If the question was not about patterns but about those "character"s, please tell me what you think the "character" [] matches, as opposed to what can be matched by a pattern which includes the two real characters that occur in that "character" as well as some other characters placed between them. I know very well that X LIKE '[]'returns false unless X is NULL (in which case it returns unknown when the settings are ANSI-conformant, and false otherwise), but apparently you believe something different.

    Tom