BACKUP SYNTAX
michellem33
Posts: 19
Hi,
I have been trying to get the backup syntax correct but with no success. I would like to specify a password for encryption as well as the compression level. I am able to backup with encryption using the following command:
xp_cmdshell 'C:\progra~1\RedGat~1\SqlBac~1\sqlbac~1.EXE -SQL "BACKUP DATABASE master TO DISK = ''f:\backup\master\masterkeycomp7_db_200512141310.BAK.SQB'' WITH PASSWORD = ''test''"'
I had tried to add the COMPRESSION = ''3'' argument with no success. Could I please have some help with I am doing wrong or point me in the direction of some useful examples. :oops:
I have been trying to get the backup syntax correct but with no success. I would like to specify a password for encryption as well as the compression level. I am able to backup with encryption using the following command:
xp_cmdshell 'C:\progra~1\RedGat~1\SqlBac~1\sqlbac~1.EXE -SQL "BACKUP DATABASE master TO DISK = ''f:\backup\master\masterkeycomp7_db_200512141310.BAK.SQB'' WITH PASSWORD = ''test''"'
I had tried to add the COMPRESSION = ''3'' argument with no success. Could I please have some help with I am doing wrong or point me in the direction of some useful examples. :oops:
Comments
Is there a reason you need to use xp_cmdshell? You could try using the sqlbackup extended stored procedure directly e.g.
exec master..sqlbackup '-SQL "BACKUP DATABASE master TO DISK = [f:\backup\master\masterkeycomp7_db_200512141310.BAK.SQB] WITH PASSWORD = [test], COMPRESSION = 3 " '
SQL Backup Consultant Developer
Associate, Yohz Software
Beyond compression - SQL Backup goodies under the hood, updated for version 8