- mql cloud
- Pause EA in Strategy Tester to wait for SQL Server
- Meta4 To Mssql Server Connect
Are there any examples available of connecting MQL5 to Microsoft SQL Server Integration Services to execute SSIS packages?
For what usage ?
I want to use the command line execute option of SSIS
Here is the link on how to execute an SSIS package from a command line utility, http://blog.sqlauthority.com/2011/05/21/sql-server-running-ssis-package-from-command-line/. How do I get MQL5 to get the command line utility to execute that?

- 2011.05.21
- Pinal Dave
- blog.sqlauthority.com
I'm not a MQL expert so maybe there are some other better solutions...
If your script allows importing functions from external DLL, in your script, you may import "shell32.dll" and export the "ShellExecuteW" API from the DLL. The DLL is a standard Windows system DLL.
Sample code:
#import "shell32.dll" int ShellExecuteW(int hWnd, string operation, string file, string parameters, string directory, int showcmd); #import void OnStart() { //--- ShellExecuteW(0, "open", "notepad.exe", "d:\\test.txt", "", 5); // 5 is the value of SW_SHOW constant }
The above sample code opens the Windows Notepad application and create/open the "d:\test.txt" file.
BTW, when you are running the code, you need to allow it to use external DLL. (Check the "Allow DLL imports" checkbox in the "Dependency" sheet).
Hope it helps.
I'm not a MQL expert so maybe there are some other better solutions...
If your script allows importing functions from external DLL, in your script, you may import "shell32.dll" and export the "ShellExecuteW" API from the DLL. The DLL is a standard Windows system DLL.
Sample code:
The above sample code opens the Windows Notepad application and create/open the "d:\test.txt" file.
BTW, when you are running the code, you need to allow it to use external DLL. (Check the "Allow DLL imports" checkbox in the "Dependency" sheet).
Hope it helps.
Where do I check "Allow DLL imports"? I do not know where the "Dependency" sheet is located. I checked through all of the menu items in MetaEditor and found nothing
You don't need to do this when compiling the script. When you run the script, it needs your permission to allow the script to import function from DLL.
I do not see a window with those tabs. This is all I see and dependencies is not one of the tabs
I do not see a window with those tabs. This is all I see and dependencies is not one of the tabs
Alos, since I only want to pass a string (see below) to the run command, what values should I use for the parameters of the ShellExecuteW command?
dtexec /f "C:\Users\jeff\Documents\Visual Studio 2008\Projects\Integration Services Project1\Integration Services Project1\truncate.dtsx"
Alos, since I only want to pass a string (see below) to the run command, what values should I use for the parameters of the ShellExecuteW command?
dtexec /f "C:\Users\jeff\Documents\Visual Studio 2008\Projects\Integration Services Project1\Integration Services Project1\truncate.dtsx"
My sample code is a Script but not EA or Custom Indicator, so it asked your permission to run the script. You don't need to care about the "DLL Import" issue if MetaTrader didn't ask for it.
And about the parameters, you may try this:
ShellExecuteW(0, "open", "dtexec.exe", "/f \"C:\\Users\\jeff\\Documents\\Visual Studio 2008\\Projects\\Integration Services Project1\\Integration Services Project1\\truncate.dtsx\"", "", 5);

- 2009.11.23
- Андрей
- www.mql5.com
My sample code is a Script but not EA or Custom Indicator, so it asked your permission to run the script. You don't need to care about the "DLL Import" issue if MetaTrader didn't ask for it.
And about the parameters, you may try this:

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use