April 19, 2021 at 10:40 am
Hi there
I have a table for which archiving functionality is required.
Now I have thought of writing sonmething in t-sql to use BCP to write to csv or caret delimited file
There is a requirement that this file be made tamper proof and read only.
Apart from setting the file attribute to read only, is there a way of putting a lock on the file...so that someone
couldnt read it?
April 19, 2021 at 11:50 am
You could encrypt it with a password. You can use the Data Protection API (DPAPI). Here's an article on it. Another showing how to create a password protected zip file. And another set of examples on certificate encryptions. One of these approaches ought to do the trick. I can't think of any other way to ensure files, outside of a management system, are protected.
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
April 19, 2021 at 11:55 am
If no one is allowed to read it, it might as well be compressed so it doesn't take as much room so I agree with Grant's suggestion of converting it to a password protected ZIP file.
Just make sure that the password is stored somewhere safe. The company should have a "password locker" somewhere.
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply