Lock my db in client's machine

I want to put my sql server db in my client"s machine without letting anybody else (even not the sa) the possibility to copy it's contents.
how can i lock my db with 100% safety?

thanks

In SQL Server, you can't prevent a sysadmin from accessing anything on the system.

Even if you encrypt the data, to read it, you'd have to decrypt it. Maybe you could put all of the decryption in a CLR module that was protected, but I'm not sure if that's actually doable or not.

This is going to be extremely difficult to do in SQL Server.

1 Like

So what is the use case here? what are you trying to accomplish? why is your db in the client's machine? Is it microsoft sql server db? what is the db accompish/purpose?

it is microsoft sql server db. the client want to hold his data on his machine. the plan is to analyse client's
data in my db and push the results to him.
i want to keep my uniqe formulas stored in my db from stragers eyes in a locked db and extract my db's result to another db that is open to the client

Unfortunately the CLR is .NET so is relatively easy to decompile.

If your formulas are really that secret you will need to host the entire application or at least have the formulas hosted using something like web services.

You might also want to look at:
https://www.database-encryption.com/

So does the client interact with db directly or through an application?

directly

using what?

2 sql dbs. One db get's data and after process push's the results to a second db.
the result db can be viewed by any application but the process db is blocked to not authorized.