I have a column that may have Credit Card number(s) in the string. What I need to do is find out rows that has credit card number(s) in this column. But this column will also have couple of dates in it.
Any better suggestion please... This column can have multiple CC#s!!! Anyone has any function to find the CC#?
1. There's no easy way to parse credit card numbers using SQL, especially multiples, especially if they have multiple formats. 2. I hope you don't have to comply with PCI or similar regulations, since storing unencrypted card numbers is a violation. 2a. And even if you don't have to comply, your company is open to all kinds of lawsuits should there be a security breach.
As far as finding the credit card numbers, the only reasonable solution I can think of is to use regular expressions. You can use a SQLCLR function to perform these kinds of matches:
But first and foremost, you need to clean those out of your database and change how that data is entered into your system (or not at all). Google "largest credit card breaches" for more info on the potential consequences.
Thanks Rob for the response. Yes we have made changes to the application; however, I need to find the records in database (in that particular column) where there is at least one CC# in the string. We will then plan to take correct measures to obfusicate this.