Posted by Erland Sommarskog on 09/14/07 21:38
Hugo Kornelis (hugo@perFact.REMOVETHIS.info.INVALID) writes:
> Are you sure you need to check only the first character for numeric? All
> my credit cards have only numbers. To test for length 14 and only
> numbers, you can change the above to
>
> WHERE LEN(YourColumn) = 14
> AND YourColumn NOT LIKE '%[^0-9]%'
And my two credit-cards have 16-digit numbers...
--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
[Back to original message]
|