Click here to Skip to main content
15,897,187 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
Hii,,


Please explain diffence betwee password and media password in sql server?
as we use

1. BACKUP DATABASE mydb
TO DISK = N'C:\mydb.bak'
with INIT
,mediapassword = 'sqlpass'
,NAME = 'Full Backup of mydb';

2. 1. BACKUP DATABASE mydb
TO DISK = N'C:\mydb.bak'
with INIT
,password = 'sqlpass'
,NAME = 'Full Backup of mydb';

please explain the difference..

thanx.
Posted
Comments
[no name] 19-Apr-13 0:48am    
If I want to restore database with replace in other system .Can I face any issues ??

1 solution

password:

"If a password is defined for the backup set, the password must be supplied to perform any SQL Server restore operation from the backup set. A backup set password does not protect the backup file from being overwritten, however. To prevent a backup file from being overwritten, use a media-set password instead."

mediapassword:

"If a password is defined for the media set, the password must be supplied before you can create a backup set on that media set. In addition, that media password also must be supplied to perform any restore operation from the media set. Password-protected media may be overwritten only by reformatting."
 
Share this answer
 
Comments
[no name] 19-Apr-13 0:58am    
If I want to restore database with replace in other system .Can I face any issues ??
RedDk 19-Apr-13 13:39pm    
Sort of depends upon whether there's a password of any kind. I can say this though, if there's no password, copying a .mdf/.ldf combo to "another" machine then ATTACHing it to the instance ... should be alright. As long as you've got copies why not experiment?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900