Backup issues with double quotes and brackets
There appear to be issues with SqlBackup working with databases whose names contain double quotes, or backing-up to .sqb files whose names contain square brackets.
Here's an example of the former
EXECUTE master..sqlbackup N'-SQL "BACKUP DATABASE [BJS_""_TEST] TO DISK = ''\\MyServer\Share\BJS_TEST.sqb'' WITH COMPRESSION = 2, INIT, VERIFY"'
Results in: "SQL error 911: Could not locate entry in sysdatabases for database 'BJS_ _TEST'. No entry found with that name. Make sure that the name is entered correctly."
The double quotes appear to have been stripped from the name.
Here's an example of the latter:
EXECUTE master..sqlbackup N'-SQL "BACKUP DATABASE [BJS_TEST] TO DISK = ''\\MyServer\Share\_bjsTest[me]_ok.sqb'' WITH COMPRESSION = 2, INIT, VERIFY"'
Results in: "Syntax error: 'me'_ok.sqb'' after '\\MyServer\Share\_bjsTest'"
The brackets appear to have been replaced with single quotes in the error message, though I'm not sure if that's the actual problem.
We can easily work around the problem with brackets in the filename, since we control the backup files, but working around the double quotes in our clients' database names will be more difficult.