Microsoft SQL Server Integration Services

 
Are there any examples available of connecting MQL5 to Microsoft SQL Server Integration Services to execute SSIS packages?
 
jshumaker:
Are there any examples available of connecting MQL5 to Microsoft SQL Server Integration Services to execute SSIS packages?
For what usage ?
 
angevoyageur:
For what usage ?
I want to use the command line execute option of SSIS
 
jshumaker:
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?

SQL SERVER – Running SSIS Package From Command Line
SQL SERVER – Running SSIS Package From Command Line
  • 2011.05.21
  • Pinal Dave
  • blog.sqlauthority.com
This is really interesting question and very easy one as well. You can execute SSIS Package using command line utility. When you run above command it will give you start time, end time and total progress of...
 

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.

 
forex2start:

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
 
jshumaker:
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.
Files:
mql5.png  32 kb
 
forex2start:
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

.mql5

 
jshumaker:

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"

 
jshumaker:

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);
Step on New Rails: Custom Indicators in MQL5
Step on New Rails: Custom Indicators in MQL5
  • 2009.11.23
  • Андрей
  • www.mql5.com
I will not list all of the new possibilities and features of the new terminal and language. They are numerous, and some novelties are worth the discussion in a separate article. Also there is no code here, written with object-oriented programming, it is a too serous topic to be simply mentioned in a context as additional advantages for developers. In this article we will consider the indicators, their structure, drawing, types and their programming details, as compared to MQL4. I hope that this article will be useful both for beginners and experienced developers, maybe some of them will find something new.
 
forex2start:

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: 

If I include that line of code, Strategy Tester does not process ticks.  Instead it just freezes.
Reason: