I am working with sensitive/private files stored in SQL Server as VarBinary(MAX). Is there a way to tell the database or nHibernate to nullify the column after a period of time after its creation.
+2
A:
Make sure to put a timestamp column on the table, then set up a SQL Scheduled Job with a query to delete those rows periodically based on that time.
phoebus
2009-10-07 01:03:14
just to clarify; a timestamp is a datatype in SQL Server that has nothing to with time. You meant a datetime column :)
Stuart Ainsworth
2009-10-07 02:44:38
No, I wasn't using timestamp as a datatype. Just as a general concept. A timestamp being a stored date/time value when something occurred.
phoebus
2009-10-07 02:50:19
A:
Absolutely not
Imagine the fun when SQL Server decides to change data apparently on it's own because the code monkey fluffed setting up whatever mechanism would be used...
You could (off top of my head):
- Encrypt the columns
- Schedule a clean up (SQL Agent job, a config table)
- Don't use SQL Server for the files themselves, just store paths/links
gbn
2009-10-07 04:12:03