Creating EXE with multiple scripts and custom commandline

Forum for users of SQL Packager database archive utility

Creating EXE with multiple scripts and custom commandline

Postby Tadul » Fri Feb 08, 2013 6:20 am

Can i supply more than one SQL scripts (.SQL files) and generate an exe with custom commandline?

for ex. i have a .bat file to be run passing certain command line parameters.This batch file calls many .sql files and update databse can i create an exe which runs all required like mentioned above by batch file.I want to pass custom arguments which i will take it from registry.

Please Help
Posts: 1
Joined: Fri Feb 08, 2013 5:58 am

Postby james.billings » Mon Feb 11, 2013 3:26 pm

You can only package up one script- but once done, you could run that against whichever server/databases you want, as detailed here

For reference, the generated package offers the following command-line options:

Code: Select all
Red Gate SQL Packager 'PackagerTest'
Command line options:

   The name of the sql server. The default is (local)

   The name of the database

   The user name for the database

   The password for the database

   Indicates the package will run without any user interface

   Indicates the database will be created in the specified server

   Indicates the database will be upgraded on the specified server

   Allows you to specify a file containing a SQL script to run before the package executes

   Allows you to specify a file containing a SQL script to run after the package executes


  - PackagerTest.exe /server:MyServer /database:MyDatabase /makedatabase
  - PackagerTest.exe /server:MyServer /database:MyDatabase /username:MyUserName /password:MyPassword

Posts: 1122
Joined: Wed Jun 16, 2010 10:10 am
Location: Red Gate

Handling Nested Sql scripts possible with RedGate ?

Postby bahrani » Tue Apr 30, 2013 1:33 pm


I have one scenario wherein i have one sql script (Main.sql) to which i pass some arguments and execute the sql script using SQLCMD command
SQLCMD -S %1 -U %2 -P %3 -d %4 -i Main.sql -v Argument1="%4" -v Argument2="%5" -v Argument3="%4" -v filepath="%CD%" -o sql_Log_Module.txt)

This sql script (Main.sql) internally calls some more sql scripts and these internal nested scripts use the parameters passed to the main script i.e., "Main.sql" (mentioned above)

Internal scripts also have the stored procedures which gets executed

Currently we execute sql script (Main.sql) directly in batch file with the help of SQLCMD command, but we are thinking to use Red Gate (SQL Packager) instead of SQLCMD in batch file

It will be great if you provide some inputs on whether this can be done with the help of RedGate or not, i mean to say whether this is possible with the help of RedGate or not

Thanks in advance,
Posts: 3
Joined: Tue Apr 30, 2013 11:34 am
Location: Mumbai

Return to SQL Packager Previous Versions

Who is online

Users browsing this forum: Yahoo [Bot] and 0 guests