question

harshvyas avatar image
harshvyas asked

How do i take Backup of Database with password?

I am currently using SQL SERVER 2012 Express Edition.
Now I want to take backup of my database With password protection.
So i tried
BACKUP DATABASE [NAME] TO DISK ='[PATH]' WITH PASSWORD='[PASSWORD]' But it showed error that SQL SERVER 2012 Does not support the "WITH PASSWORD". Can any one please help me with the solution. I want to backup DB with password Protection.
backupbackup-restorepasswordsql-server-2012-express
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

JohnM avatar image
JohnM answered
With the 2012 (and higher) Express versions, I think that your options are limited to third party solutions such as Red Gate's SQL Backup - http://www.red-gate.com/products/dba/sql-backup/ TDE is an Enterprise version only solution and you can't natively encrypted backups until 2014, which also requires Standard or higher per the supported features list: https://msdn.microsoft.com/en-us/library/cc645993(v=sql.120).aspx Not sure what else to suggest. Someone else might be able to offer up a suggestion. Is the purpose to secure the backup file itself or the contents within it?
3 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

KenJ avatar image KenJ commented ·
I don't know if OP was looking for encryption or just password protection which was available through SQL Server 2008 R2. For newer versions, BOL says "Beginning with SQL Server 2012, the PASSWORD and MEDIAPASSWORD options are discontinued for creating backups. It is still possible to restore backups created with passwords."
1 Like 1 ·
harshvyas avatar image harshvyas commented ·
No i Just want the Backup password protected not the data of it. as per suggested by @KenJ i don't want my db encrypted. i heard that PASSWORD & MEDIAPASSWORD are discontinued so are there any other options available similar to that.
0 Likes 0 ·
JohnM avatar image JohnM commented ·
As mentioned, I'm not sure what else to use other than third party options. The only other thought that I had was to ensure that your backup location is as secure as possible. The purpose of the password is such that if someone gets the files they can't restore it without the password. If you prevent someone from getting the file to start with, you've accomplished the same thing just in a different manner. Not quite the same thing I know. It was just a thought.
0 Likes 0 ·
Shawn_Melton avatar image
Shawn_Melton answered
You can utilize something like 7zip or WinZip to put the backup file into a compressed file, then password protect the compressed file. I know 7zip supports passing the password through the command line if you need to automate the process, not sure on WinZip.
1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

harshvyas avatar image harshvyas commented ·
Thanks for the suggestion but i cant use it as i want to make backup password protected through one windows application and via coding, also i just wanted the password protected .bak file not a zip file.
0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.