You are here: Re: Search for specific length string in column « MsSQL Server « IT news, forums, messages
Re: Search for specific length string in column

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
>

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация