Home Forums Programming General Weird issue with unicode and pattern matching RE: Weird issue with unicode and pattern matching

  • Maybe you could do this to find offending rows.

    select fieldname

    from tablename

    EXCEPT

    select fieldname

    from tablename

    where fieldname

    NOT LIKE N'%[^'+nchar(0x9)+nchar(0xA)+nchar(0xD)+nchar(0x20)+N'-'+nchar(0xD7FF)+N']%'

    The NOT LIKE N'%[^Pattern]%' will return non-offending rows. The EXCEPT will return the other rows.

    You have a wide range in there, that might be causing the lack of results.

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2