I have a packaged script which I have compiled into an executable.
If I run using the GUI and select local credentials and upgrade 'master' database it works fine.
However I need to schedule this script so I need to execute using command line parameters but I cannot get the command line options to perform an upgrade it always tries to make the database and obviously fails because the db exists.
I would expect to execute the following:
autobackup /server:XXXX /quiet /database:master
Since /makedatabase has not been specified I would expect it to upgrade
Am I missing something?
(NB: Running SQL Express on this box so don't have the SQL Server Agent hence this technique)
A very simple script with three BACKUP DATABASE statements. And as I say it works fine from the GUI, it just appears that the command line interface doesn't provide me with the correct combination of switches.
I've just tested this out and have also been unable to package a backup script. Whenever you run the package it will always try to create the database set in /database. This is a bug with the tool (SPA-494), and I can't see any workaround.
If you have the SQL tools installed on the machine, you could always write a batch file using sqlcmd to backup the databases. Or if you don't have the sql tools you could probably do it using a vb script.
Is there any particular reason why you would rather do this with SQL Packager?