SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 Set Password on restore database
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

zee_ahmed
Starting Member

Pakistan
1 Posts

Posted - 10/05/2002 :  05:02:42  Show Profile  Reply with Quote
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

United Kingdom
846 Posts

Posted - 10/05/2002 :  11:29:59  Show Profile  Visit jasper_smith's Homepage  Reply with Quote
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

United Kingdom
313 Posts

Posted - 10/06/2002 :  16:30:14  Show Profile  Visit VyasKN's Homepage  Reply with Quote
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
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.03 seconds. Powered By: Snitz Forums 2000