Sql-server – Securely remove columns (and traces thereof) from a SQL database

Securitysql serversql-server-2008

I've come upon a database that has previously held sensitive data (think "passwords/credit-card-numbers" kind of sensitive) in plain text. All of the sensitive data in question has been deleted, but I'm concerned that if accessed by someone with malicious intentions, the data might be recoverable through backups and/or transaction logs.

Is there a way to permanently and securely delete certain columns out of transaction logs and/or backup files while maintaining the integrity of all other data in a SQL database?

Best Answer

Well there is always a chance that someone can find the bits at various hardware layers if they had access to the physical disk(s), but I think you can be fairly confident you have removed traces of the data accessible through less nefarious means by:

  1. rebuilding the table where the column was removed (perhaps perform a select into, drop the old table, rename the new one, and re-create any indexes)
  2. starting the log chain over (a new full backup)
  3. forcing the log to wrap around and re-zero-initialize by backing the log up twice and then performing a slight shrinkfile
  4. eradicating any old full/diff/log backups (you may want to wait on this step until your data recovery window has passed, e.g. if you might still need to recover back to last Monday, wait until two Mondays from now - in the meantime moving them to a more secure location). At some point you know that a backup from two weeks ago is absolutely useless, because you're not going to restore to a point in time that far back, so why keep it around?