Sql-server – How to prevent/detect that a end user restored a backup

sql serversql-server-2008

We need to prevent the SQLServer 2008 .mdf file from being replaced by the end user of our application.

we collect data in the MDF that is important to us. If the user saves an old copy of the MDF, and then restore it at a later date, we lose that data. We want to prevent the user from doing this.

Is it possible, and if so, how could it be done?

Best Answer

If you want to prevent the table from being deleted, see here: http://pratchev.blogspot.com/2007/12/prevent-table-drop.html. If you want to prevent the data from being altered by the end user, simply do not give your users modify permissions to that table.

If you set up your user accounts and permissions properly, changing out the MDF won't work, because the user accounts and credentials won't line up.