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.

2 Replies

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?

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."

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.

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.

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.

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.

Your answer

Hint: You can notify a user about this post by typing @username

Attachments:
Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.