简体   繁体   中英

Prevent attachment of my local database in another SQL Server and prevent to access my data?

I have a local SQL Server database. I connect it from my application to do what I need. The main problem is any one can attach my local database from any instance of SQL Server and access my data. In access database we can set a password on the database and prevent access to the data, but for SQL Server I can't find a solution to set a password on an SQL Server database and prevent it from being attached and the data accessed for any administrator. My database version is SQL Server 2012.

What do you recommend to solve this problem?

There is no concept of password on the database level in the SQL server but if you want to protect your database to be restored and want to encrypt your data while it is at Rest. You can use the SQL Server Transparent Data Encryption (TDE) feature. Once TDE is enabled on the database. Your database will be encrypted and certificate and the master key will be required to restore the database.

See more details on this link for TDE - https://docs.microsoft.com/en-us/sql/relational-databases/security/encryption/transparent-data-encryption?view=sql-server-2017

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM