Sådan trak jeg SQL'en fra en Execute SQL-opgave:
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)
{
Hvis jeg nu bare kan finde ud af, hvordan jeg udtrækker sqls fra en dataopgave:
MainPipe pipeline = taskHost.InnerObject as MainPipe;
if (pipeline != null)
{
foreach (IDTSComponentMetaData100 componentMetadata in pipeline.ComponentMetaDataCollection)
{
try
{???
Hvad nu?