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:
michellem33
0

Comments

1 comment

  • petey
    The compression value need not be enclosed in single quotes.

    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 " '
    petey
    0

Add comment

Please sign in to leave a comment.