1

How can I connect a SQL task to a data flow task programatically?

SQL Task:

Executable exec = package.Executables.Add("STOCK:SQLTask");
TaskHost thMainPipe = (TaskHost)exec;

...

Data flow:

MainPipe mp = ((TaskHost)stagingPackage.Executables.Add("DTS.Pipeline")).InnerObject as MainPipe;

...

Tried using PrecedenceConstraints.Add, get COM error.

PrecedenceConstraints.Add(derivedTask,(Executable) mp);

Unable to cast COM object of type 'System.__ComObject' to class type 'Microsoft.SqlServer.Dts.Runtime.Executable'.

4
  • 1
    Use STOCK:PipelineTask in place of DTS.Pipeline Commented Jul 4, 2013 at 14:43
  • post complete code block to understand this issue, thnx Commented Jul 4, 2013 at 14:50
  • S.M, it worked. What is the difference between the two? Commented Jul 4, 2013 at 14:59
  • See my post as an answer, Up Vote / Accept my answer if it's solved your problem. Commented Jul 4, 2013 at 15:23

1 Answer 1

1

Use STOCK:PipelineTask in place of DTS.Pipeline. Executables.Add() Method expect CLSID, PROGID, STOCK moniker, or CreationName property of the TaskInfo object. STOCK moniker is mostly used. DTS.Pipeline might not have recognized as any of them. If not using Stock Moniker, specify CLSID or PROGID equivalent to STOCK:PipelineTask.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.