SQL Packager

Latest version: 6.4

SQL Packager

Knowledge Base

Package created from script always creates database

Category: Troubleshooting & error messages
Date: 30 Oct 2009
Product: SQL Packager
Versions: 6.0
Fix version: 6.2 (ftp://support.red-gate.com/patches/SQL_Packager/SQL%20Packager_6.2.1.3.zip)

When running a SQL Package executable from the command line, a new database is always created regardless of whether or not the /makedatabase switch is specified. This happens only when the package had been created by packaging an existing SQL script file.

There is a bug in the SQL Packager code template that will cause the package to create a database whenever the saved package properties specify a new database package, and the command-line arguments do not override this. Packaging a script always behaves as if a new database will be created.

As a workaround, the "SQL Packager Code Templates" files can be modified so that the presence command-line /makedatabase switch will override the database creation setting saved into the package. To do this:

  · Use Windows Explorer to browse to %programfiles%\red gate\sql packager 6\SQL Packager Code templates\C#
  · Open PackageExecutor.cs using Notepad
  · From the Edit menu, choose "Go To" and go to line 421, and open a new line above the line beginning with "m_MakeDatabase = "
  · Insert the following text in the new line:
           if (!PackageUtils.ConsoleMode)

All SQL Packager projects created after this modification will that are run from the command prompt will only create a new database when the "/makedatabase" switch is used.

Document ID: KB200903000376 Keywords: SQL, Packager,makedatabase,console,command,create

Was this article helpful?

Search support
Forums
Visit the SQL Packager forum.

SQL Packager

all SQL products

all products