Afficher un message
Vieux 14/09/2007, 22h38   #4
Erland Sommarskog
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Search for specific length string in column

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/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx
  Réponse avec citation
 
Page generated in 0,04745 seconds with 9 queries