Package Execution Command Line Problem

Packages and compresses schema and contents of SQL Server databases

Package Execution Command Line Problem

Postby TreeMan » Thu Jan 22, 2009 11:45 am

Hey,

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)

Cheers,
Mark
TreeMan
 
Posts: 4
Joined: Thu Jan 22, 2009 11:29 am

Postby Chris Auckland » Mon Jan 26, 2009 6:28 pm

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?
Chris
Chris Auckland
 
Posts: 757
Joined: Tue Oct 24, 2006 2:12 pm
Location: Red Gate Software Ltd.

Postby TreeMan » Mon Jan 26, 2009 6:37 pm

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,
Mark
TreeMan
 
Posts: 4
Joined: Thu Jan 22, 2009 11:29 am

Postby Chris Auckland » Mon Jan 26, 2009 7:09 pm

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.
Chris
Chris Auckland
 
Posts: 757
Joined: Tue Oct 24, 2006 2:12 pm
Location: Red Gate Software Ltd.

Postby TreeMan » Tue Jan 27, 2009 9:47 am

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.
TreeMan
 
Posts: 4
Joined: Thu Jan 22, 2009 11:29 am

Postby TreeMan » Tue Jan 27, 2009 9:58 am

I have now done this with SQLCmd, I really should have done this in the first place thinking about it :) Oh well...
TreeMan
 
Posts: 4
Joined: Thu Jan 22, 2009 11:29 am


Return to SQL Packager 6

Who is online

Users browsing this forum: No registered users and 1 guest