• Since the OP doesn't actually test the bounds of an specific integer type, it can be confusing. However, the Reg-Ex in the OP is nice, and I prefer to use it directly in my WHERE clause instead of a function, such as:

    SELECT

    1

    WHERE

    MyField NOT LIKE '%[^0-9]%'

    Double-negeatives are... awesome... at least in this case.

    To break it down, the LIKE + "^" with wildcard "%" surrounding the pattern returns true if *any* character in the test string set is not in the set of 0 to 9.

    The NOT returns true only if the LIKE condition returns false.

    However, one cannot just take out both of the negatives and get the same result, as the pattern would then only search to see if any single character in the string was a valid 0 to 9 digit, regardless if other characters in the test string set were not.

    So, I SELECT 'LIKE' WHERE 'NOT' NOT LIKE '[^NOT]' (Result = 'LIKE'), and which backwards NOT is a ton spelled.