Red Gate forums :: View topic - Handling Nested Sql scripts possible with RedGate ?
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

Handling Nested Sql scripts possible with RedGate ?

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



Joined: 30 Apr 2013
Posts: 3
Location: Mumbai

PostPosted: Tue Apr 30, 2013 2:35 pm    Post subject: Handling Nested Sql scripts possible with RedGate ? Reply with quote

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


Last edited by bahrani on Wed May 15, 2013 3:10 pm; edited 4 times in total
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
Manfred.Castro



Joined: 23 Apr 2012
Posts: 209

PostPosted: Wed May 01, 2013 6:57 pm    Post subject: Reply with quote

Unfortunately I was unable to find previous instances where SQL Packager was used in this manner, so I can't say for certain that it will work.
One thing that concerns me is how do you intend to pass arguments to SQL packager since that is not supported. I suppose if the arguments were supplied within the script itself it may work.
I would suggest you try it for yourself, to see if the tool for work for you in this use case.
_________________
Manfred Castro
Product Support
Red Gate Software
Back to top
View user's profile Send private message
bahrani



Joined: 30 Apr 2013
Posts: 3
Location: Mumbai

PostPosted: Thu May 02, 2013 9:09 am    Post subject: Reply with quote

Thanks for your inputs

Yes regarding arguments while generating .exe for .sql script I was trying to pass arguments to SQL Packager with .sql script itself but as you rightly mentioned i was not able to do so.

So i thought lets generate the .exe first and then there might be some provision to pass arguments to the .exe which gets generated with the help of SQL Packager (with .sql script as input to SQL Packager) but later on after obtaining the .exe from SQL Packager i realised that we can pass only some predefined fixed arguments to .exe (like servername, databasename, username, password, makedatabase or makeupgrade, presql, postsql)

Also the requirement is such that the values of the arguments gets generated at runtime based on the user inputs and hence values of arguments are not fixed so keeping arguments internally within the script with fixed values will not satify our requirement

So what i understand from your inputs and with some hands on is that we cannot handle the scenario with the SQL packager wherein .sql scripts needs some arguments as inputs, right ?

Correct me if i am wrong

Thanks,
Ishant
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
Manfred.Castro



Joined: 23 Apr 2012
Posts: 209

PostPosted: Thu May 02, 2013 4:23 pm    Post subject: Reply with quote

I don't believe that this particular tool will work in your use case.
You may want to check out our other product the SQL Comparison SDK.
http://www.red-gate.com/products/sql-development/sql-comparison-sdk/
This tool allows you to use SQL Packagers API to create your own application.
_________________
Manfred Castro
Product Support
Red Gate Software
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