Prevent database file from copying

2019-07-29 13:34发布

问题:

I want to deploy a .NET application on client machine. I don't know how to protect my database .mdf and .ldf files from copying. Is there any way to prevent them also from copying these files? I'm using SQL Server 2008 R2.

回答1:

Short answer NO!

If they own that server there's little you can do.

If they are consuming your DB means they have a connection string to it. By using that connection string they can do a lot of things.

You can try to cryptography your DB, create just a handsome of users with specific crud operations permissions, etc.

But if they own the server they virtually have ultimate control over anything running on it.

And by the merit of just coping files, they can do what they want.

If you want to provide a service/application and don't want to provide clients to copy your precious data you ill need to host that by yourself or by a trustworthy third party.