Tharif
Tharif

Reputation: 13971

how to restrict sql database to be opened in other servers?

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

Answers (1)

Arun Gairola
Arun Gairola

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:

Backup

Upvotes: 3

Related Questions