Package Execution Command Line Problem

TreeManTreeMan Posts: 5
edited January 27, 2009 3:58AM in SQL Packager Previous Versions

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)



  • Thanks for your post.

    It looks like you've got the right idea. The packaged script will run in the context of the database specified by /database.

    What exactly do you have in the script that you've packaged?
  • Hi,

    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.

  • Thanks for your reply.

    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?

    I hope this is helpful.
  • No I will use another technique it isn't a major problem I just wanted to know why it didn't work.

    The reason I went to use packager is because I wanted to have a play with it and looked like it would extremely straightforward.

    Well at least I found a bug, for now I will use an alternative method.

    Thanks for your replies.
  • I have now done this with SQLCmd, I really should have done this in the first place thinking about it :) Oh well...
Sign In or Register to comment.