SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Find CC# From String
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

SQLNOVICE999
Yak Posting Veteran

57 Posts

Posted - 03/26/2013 :  11:26:52  Show Profile  Reply with Quote
Hi Guys,

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#?

Thanks,
Laura

Edited by - SQLNOVICE999 on 03/27/2013 16:14:44

robvolk
Most Valuable Yak

USA
15639 Posts

Posted - 03/26/2013 :  11:52:08  Show Profile  Visit robvolk's Homepage  Reply with Quote
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:

http://msdn.microsoft.com/en-us/magazine/cc163473.aspx

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.
Go to Top of Page

SQLNOVICE999
Yak Posting Veteran

57 Posts

Posted - 03/26/2013 :  12:10:57  Show Profile  Reply with Quote
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.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.03 seconds. Powered By: Snitz Forums 2000