Så här hämtade jag SQL från en Execute SQL-uppgift:
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)
{
Om jag nu bara kan ta reda på hur man extraherar sqls från en datauppgift:
MainPipe pipeline = taskHost.InnerObject as MainPipe;
if (pipeline != null)
{
foreach (IDTSComponentMetaData100 componentMetadata in pipeline.ComponentMetaDataCollection)
{
try
{???
Vad nu?