Help with Error 850 Syntax error:
ColmK
Posts: 1 New member
in SQL Backup
Hi
I used Redgate Backup Pro to create a full and differential backups, the full is completing and the differentials are failing with the below error message
Syntax error: 'SECONDARY_REPLICA_COPY_ONLY' after ','
I grabbed the scripts from the last page of the UI....(I've replaced the list of databases and location)
The below full backup completes successfully
I used Redgate Backup Pro to create a full and differential backups, the full is completing and the differentials are failing with the below error message
Syntax error: 'SECONDARY_REPLICA_COPY_ONLY' after ','
I grabbed the scripts from the last page of the UI....(I've replaced the list of databases and location)
The below full backup completes successfully
EXECUTE master..sqlbackup '-SQL "BACKUP DATABASES [My list of databases] TO DISK = ''\\My Backup location\<AUTO>.sqb'' WITH ERASEFILES_PRIMARY = 14, CHECKSUM, DISKRETRYINTERVAL = 30, DISKRETRYCOUNT = 10, THREADCOUNT = 7, CHECK_PREFERRED_AG_REPLICA, SECONDARY_REPLICA_COPY_ONLY"'
The differential below gives the syntax error
The only difference being ......THREADCOUNT = 7, DIFFERENTIAL, C.........
I cant see what the extended SP 'master..sqlbackup' is doing, is there a bug with the string being passed in?
Can someone tell me why this is happening and offer a solution?
Thanks
The differential below gives the syntax error
EXECUTE master..sqlbackup '-SQL "BACKUP DATABASES [My list of databases] TO DISK = ''\\My Backup location\<AUTO>.sqb'' WITH ERASEFILES_PRIMARY = 14, CHECKSUM, DISKRETRYINTERVAL = 30, DISKRETRYCOUNT = 10, THREADCOUNT = 7, DIFFERENTIAL, CHECK_PREFERRED_AG_REPLICA, SECONDARY_REPLICA_COPY_ONLY"'
I cant see what the extended SP 'master..sqlbackup' is doing, is there a bug with the string being passed in?
Can someone tell me why this is happening and offer a solution?
Thanks
Tagged:
Answers
Its the use of the SECONDARY_REPLICA_COPY_ONLY keyword in the Differential backup is the problem here. The keyword can only be used for Full backups.
Differential backup aren't supported on secondary replicas hence the syntax error in SQL Backup. See this Microsoft document, the Backup Types Supported on Secondary Replicas section:
I hope the above answers your question.
Many Thanks
Eddie
Senior Product Support Engineer
Redgate Software Ltd
Email: support@red-gate.com