Reputation: 13971
Currently i have a database that is attached to a named instance server with login credentials ,but at the same time if i attach the database to another server in other system ,the same gets opened.
How to deal with this?
Is there a way to restrict the database file to opened by others without valid credentials ?
Upvotes: 2
Views: 65
Reputation: 884
You can do a BACKUP
with MEDIAPASSWORD
.
Here is the T-SQL command to backup your database:
BACKUP DATABASE Northwind TO DISK='C:\abc.BAK' WITH MEDIAPASSWORD='abc12345'
Reference Links:
Upvotes: 3