Red Gate forums :: View topic - Package Execution Command Line Problem
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
SQL Packager 6
SQL Packager 6 forum

Package Execution Command Line Problem

Search in SQL Packager 6 forum
Post new topic   Reply to topic
Jump to:  
Author Message
TreeMan



Joined: 22 Jan 2009
Posts: 4

PostPosted: Thu Jan 22, 2009 11:45 am    Post subject: Package Execution Command Line Problem Reply with quote

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
Back to top
View user's profile Send private message
Chris Auckland



Joined: 24 Oct 2006
Posts: 757
Location: Red Gate Software Ltd.

PostPosted: Mon Jan 26, 2009 6:28 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message Send e-mail
TreeMan



Joined: 22 Jan 2009
Posts: 4

PostPosted: Mon Jan 26, 2009 6:37 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
Chris Auckland



Joined: 24 Oct 2006
Posts: 757
Location: Red Gate Software Ltd.

PostPosted: Mon Jan 26, 2009 7:09 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message Send e-mail
TreeMan



Joined: 22 Jan 2009
Posts: 4

PostPosted: Tue Jan 27, 2009 9:47 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
TreeMan



Joined: 22 Jan 2009
Posts: 4

PostPosted: Tue Jan 27, 2009 9:58 am    Post subject: Reply with quote

I have now done this with SQLCmd, I really should have done this in the first place thinking about it Smile Oh well...
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group