Discussion:
script to execute or not the next task
(too old to reply)
Miguel Canas
2010-02-05 10:31:05 UTC
Permalink
Hello,

I'm a newbie in DTS's and Integration Services, but I need to migrate a DTS
to Integration Service but it's failing when i'm migrating the activex task
(in JScript).

I have the code below:

function Main()
{
if(DTS.Variables("APAGADOS").Value !=0)
return (DTSStepScriptResult_ExecuteTask);
else
return(DTSStepScriptResult_DontExecuteTask);
}

The previous step is a SQL Task who make a select to check if there are
results in a table then i move to the next task, and if the table is empty
then he don't execute the next task and finishes.

I create already a global variable to retrieve the count of rows of the
table.

Can anyone help me?
I hope so.

Thank you

url:http://www.ureader.com/gp/1146-1.aspx
Todd C
2010-02-05 15:13:02 UTC
Permalink
Miguel,
Welcome to the Forums.
(BTW, there is also a dedicated forum for SSIS)

The functionality you desire is simplicity itself for SSIS. You can
eliminate the Script task entirely.

Between the two tasks (Execute SQL that gets the row count) and the next one
(whatever is might be) you have a green line, right? Right-click on this line
and select Edit. In the Evaluation operations, select Expression and
Constraint. In the Value, select Success. In the Expression, enter something
like the following:

@APAGADOS > 0

Lastlyt, select the "Logical AND" at the bottom.

NOTE: Variable names are case sensitive.

Now, the second task will execute if:
* The first step succeeds
AND
* The value of the variable is greater than 0 (you have rows to process)

HTH
--
Todd C
MCTS SQL Server 2005
Post by Miguel Canas
Hello,
I'm a newbie in DTS's and Integration Services, but I need to migrate a DTS
to Integration Service but it's failing when i'm migrating the activex task
(in JScript).
function Main()
{
if(DTS.Variables("APAGADOS").Value !=0)
return (DTSStepScriptResult_ExecuteTask);
else
return(DTSStepScriptResult_DontExecuteTask);
}
The previous step is a SQL Task who make a select to check if there are
results in a table then i move to the next task, and if the table is empty
then he don't execute the next task and finishes.
I create already a global variable to retrieve the count of rows of the
table.
Can anyone help me?
I hope so.
Thank you
url:http://www.ureader.com/gp/1146-1.aspx
.
Loading...