Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 Set Password on restore database

Author  Topic 

zee_ahmed
Starting Member

1 Post

Posted - 2002-10-05 : 05:02:42
There is a problm in SQL server that when we make back up of any database, the backup file can be restored on any other SQL sever successfully without having password for that database. all the objects of DB are opened.
Can any body tell me the solution

jasper_smith
SQL Server MVP & SQLTeam MVY

846 Posts

Posted - 2002-10-05 : 11:29:59
You can password protect the backup file e.g.
use master
go

backup database pubs to disk='c:\pubssecure.bak'
with password='foobar'
go

restore database pubs
from disk='e:\pubssecure.bak'
with replace -- notice we haven't supplied the password
go


Because we haven't supplied the password we get errors :

Server: Msg 3279, Level 16, State 2, Line 1
Access is denied due to a password failure
Server: Msg 3013, Level 16, State 1, Line 1
RESTORE DATABASE is terminating abnormally.

If we supply the password, restore procedes normally :
restore database pubs
from disk='e:\pubssecure.bak'
with replace,password='foobar'
go






HTH
Jasper Smith
Go to Top of Page

VyasKN
SQL Server MVP & SQLTeam MVY

313 Posts

Posted - 2002-10-06 : 16:30:14
You can password protect database backups in SQL Server 2000. See Books Online for more information.

--
HTH,
Vyas
http://vyaskn.tripod.com
Go to Top of Page
   

- Advertisement -