Ecco come ho estratto l'SQL da un'attività Esegui SQL:
foreach (Executable executable in _Package.Executables)
{
TaskHost taskHost = executable as TaskHost;
if (taskHost != null)
{
string taskHostName = taskHost.Name;
System.Diagnostics.Debug.WriteLine("SSIS Task=" + taskHostName);
IDTSExecuteSQL iDTSExecuteSQL;
try
{
iDTSExecuteSQL = (IDTSExecuteSQL)taskHost.InnerObject as IDTSExecuteSQL;
if (iDTSExecuteSQL != null)
{
Ora, se riesco a capire come estrarre sqls da un'attività dati:
MainPipe pipeline = taskHost.InnerObject as MainPipe;
if (pipeline != null)
{
foreach (IDTSComponentMetaData100 componentMetadata in pipeline.ComponentMetaDataCollection)
{
try
{???
E adesso??