![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
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 |
#3
| |||
| |||
|
|
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. |
#4
| |||
| |||
|
|
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]%' |
#5
| |||
| |||
|
|
Hugo Kornelis (hugo (AT) perFact (DOT) 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... |
#6
| |||
| |||
|
|
I have a client that was allowing people to store credit card numbers in 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. |
![]() |
| Thread Tools | |
| Display Modes | |
| |