Trying to backup all databases except one database is not working #646
-
I am trying to use the option to backup all databases but excluding one database. I have it coded like this EXECUTE [dbo].[DatabaseBackup] I get an error saying Incorrect syntax near 'database1'. so i added a comma after the parameter -database1 and I still get the same error. I'm not sure what else to try. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
You appear to be missing a single quote ( ‘ ) after the -database1. Should look something like this: EXECUTE [dbo].[DatabaseBackup] Nathan |
Beta Was this translation helpful? Give feedback.
-
Sorry, mistake in my example. There is a single quote after USER_DATABASES that should be removed. The CVS string should be in a single pair of single quotes. EXECUTE [dbo].[DatabaseBackup] |
Beta Was this translation helpful? Give feedback.
Sorry, mistake in my example. There is a single quote after USER_DATABASES that should be removed. The CVS string should be in a single pair of single quotes.
EXECUTE [dbo].[DatabaseBackup]
@databases = 'USER_DATABASES, -database1’
@Directory = NULL,
@BackupType = 'FULL',
@verify = 'Y',
https://github.com/Cleanuptime = NULL,
@Checksum = 'Y',
@LogToTable = 'N'