Validation logic for Mobile Number Column in SQL Server I am creating a validation script and need help with mobile number validation logic with below details.  Mobile number must be:


10 digits in length.
Cannot begin with a 1 or a 0 (For example:1144684679 or 04468-4679
Cannot contain all the same digit.  For example: 5555555555


I am using PATINDEX for this but could not come up with the proper result.
I seriously doubt the real world utility of the specified validation rules but a reasonably concise way of validating them is below. 

SELECT PhoneNumber,
       Valid = CASE
                 WHEN PhoneNumber LIKE CONCAT('[23456789]', REPLICATE('[0123456789]', 9))
                      AND PhoneNumber LIKE CONCAT('%[^', LEFT(PhoneNumber, 1), ']%')
                   THEN 'valid'
                 ELSE 'invalid'
               END
FROM   (VALUES ('0123456789'), 
               ('1144684679'), 
               ('5555555555'), 
               ('5555555554'), 
               ('9876543210'), 
               ('9876')) PhoneNumbers(PhoneNumber) 




+-------------+---------+
| PhoneNumber |  Valid  |
+-------------+---------+
|  0123456789 | invalid |
|  1144684679 | invalid |
|  5555555555 | invalid |
|  5555555554 | valid   |
|  9876543210 | valid   |
|        9876 | invalid |
+-------------+---------+