| Posted by Hugo Kornelis on 09/15/07 08:25 
On Fri, 14 Sep 2007 21:38:51 +0000 (UTC), Erland Sommarskog wrote:
 >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...
 
 Heh! So has mine - I didn't even think of that while posting my reply.
 
 --
 Hugo Kornelis, SQL Server MVP
 My SQL Server blog: http://sqlblog.com/blogs/hugo_kornelis
 [Back to original message] |