Showing posts with label package. Show all posts
Showing posts with label package. Show all posts

Wednesday, March 21, 2012

Graceful Exit...

I need to exit from an entire package if a data pump task fails in a sequence container.

I thought I'd use a script task to do this but I'd be glad to learn of any way to do this.

Thanks!

Enantiodrom

Hi Enantiodrom: I had to do exactly this same thing in my packages. I first set up a boolean variable named Go_NoGo and used it as a ReadWriteVariable in a Script Task. Then, within the Script Task I set the variable to either True or False, depending on conditions determined by the Script Task.

Then, on the constraint (the line connecting between tasks) between the Script Task and the next task, I put a "Precedence Constraint" that allows execution to continue to the next task only when Go_NoGo is True.

Double-click on the line connecting your Script Task and the next task in the flow. You should see the "Precedence Constraint Editor" open up. I set "Evaluation operation" to "Expression", and set the Expression to @.[User::Go_NoGo]==True

It took a long time to figure out this syntax. Don't know why the "==" is needed, but it works -- a single "=" won't work.

Also, the reference to the variable ("Go_NoGo") appears to be case-sensitive. Type it into the expression exactly as it appears in the Variables dialog. Also, make sure that the variable is global, and not locally-scoped to some task within the project.

When you set up the constraint this way, execution proceeds to the next task only if Go_NoGo is True. Otherwise, the package just ends without generating an error.

Does this make sense? Once I figured out how to create precedence constraints, I use 'em all the time! There just aren't many good examples in books online. Microsoft really needs to catch up on this one!

|||

Try to look into using failPackageOnFailure property. More details at:

http://msdn2.microsoft.com/zh-cn/library/microsoft.sqlserver.dts.runtime.dtscontainer.failpackageonfailure.aspx

Thanks,
Ovidiu Burlacu

|||

Thank you both very much; this is just what I needed.

Jim/Enantiodrom

Sunday, February 26, 2012

global variables in dtspump task

I have two connections, an oracle and sqlserver. the dtspump task is pulling data from oracle to sqlserver. I am trying to automate this package by substituting the where clause values to variables since they are based on year and month. My question is - how does one use global variables in a dtspump task? How can I use variables to do this? Can it be done or do I need to use an Active X script for it?

thanks for any help.
novice userMay check with SQL DTS (http://www.sqldts.com) website.

Global variable scope - across package

Hi,

I have a Main.dtsx file which is having executing some 10 .dtsx packages. Can I declare a variable in Main.dtsx and use it in all the other packages which it is executing?

Note: I am using Yukon April CTP

Thanks
HariniYes you can. This post explains how: http://blogs.conchango.com/jamiethomson/archive/2005/09/01/2096.aspx

-Jamie|||Thanks. This is what exactly I want.