| Author |
Message |
Tadul
Joined: 08 Feb 2013 Posts: 1
|
Posted: Fri Feb 08, 2013 7:20 am Post subject: Creating EXE with multiple scripts and custom commandline |
|
|
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 etc.so 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 |
|
| Back to top |
|
 |
james.billings
Joined: 16 Jun 2010 Posts: 840 Location: My desk.
|
Posted: Mon Feb 11, 2013 4:26 pm Post subject: |
|
|
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: |
Red Gate SQL Packager 'PackagerTest'
Command line options:
/server:<server>
The name of the sql server. The default is (local)
/database:<database>
The name of the database
/username:<username>
The user name for the database
/password:<password>
The password for the database
/quiet
Indicates the package will run without any user interface
/makedatabase
Indicates the database will be created in the specified server
/makeupgrade
Indicates the database will be upgraded on the specified server
/presql:<filename>
Allows you to specify a file containing a SQL script to run before the package executes
/postsql:<filename>
Allows you to specify a file containing a SQL script to run after the package executes
Examples:
- PackagerTest.exe /server:MyServer /database:MyDatabase /makedatabase
- PackagerTest.exe /server:MyServer /database:MyDatabase /username:MyUserName /password:MyPassword
|
|
|
| Back to top |
|
 |
bahrani
Joined: 30 Apr 2013 Posts: 3 Location: Mumbai
|
Posted: Tue Apr 30, 2013 2:33 pm Post subject: Handling Nested Sql scripts possible with RedGate ? |
|
|
Hi,
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
(e.g.
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,
Ishant |
|
| Back to top |
|
 |
|
|
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