|
Posted by Jack Vamvas on 09/14/07 17:58
select * from MyTable where len(reference) = 2 and
SUBSTRING (reference ,1 ,1 ) IN ('0','1','2','3','4','5','6','7','8','9')
you could expand and use the ISNUMERIC()
--
Jack Vamvas
___________________________________
Need an IT job? http://www.ITjobfeed.com
<mike@mcarlson.net> wrote in message
news:1189779565.603908.70530@19g2000hsx.googlegroups.com...
> SQL 2000.
>
> I need a query that will search a field in the table that is 14
> characters long and begins with a number.
>
> I have a client that was allowing people to store credit card numbers,
> plain text, in an application. I need to rip through the table and
> replace every instance of credit card numbers with "x" and the last 4
> digits. I got the replace bit going, but I am stuck on how to search
> for a string in a field of a specific length.
>
> Any ideas?
>
> Thanks,
> --Mike
>
[Back to original message]
|