dbTalk Databases Forums  

AND or OR condition?

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss AND or OR condition? in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
David N.
 
Posts: n/a

Default AND or OR condition? - 05-04-2004 , 08:38 PM







Hi All,

I see the following DTS definitions, and they confused me:

1. Step that is executed based on the success of previous STEPS

<STEP Id="s999">

<REQUIREMENT TYPE="SUCCESS" STEP="s4A"/>

<REQUIREMENT TYPE="SUCCESS" STEP="s4B"/>

<REQUIREMENT TYPE="SUCCESS" STEP="s4C"/>

<REQUIREMENT TYPE="SUCCESS" STEP="s4C_A"/>

<REQUIREMENT TYPE="SUCCESS" STEP="s4C_B"/>

<SQLCMD Id="EndPackage" CONNECTION="DESTINATION" AsRowset="false">

exec dbo.xxxxx

</SQLCMD>

</STEP>


2. Step that is executed based on the failure of previous STEPS

<STEP Id="ERROR_HANLIND">

<REQUIREMENT TYPE="FAILURE" STEP="020 "/>

<REQUIREMENT TYPE="FAILURE" STEP="s1"/>

<REQUIREMENT TYPE="FAILURE" STEP="010"/>

<SQLCMD Id="Error_Handling" CONNECTION="CONFIG" AsRowset="false">

EXEC dbo.xxxxx

</SQLCMD>

</STEP>



In my thinking, the author who developed step s999 in #1 must be thinking
that it is the AND condition that implied to the requirement. He wants all
of those previous steps to be success in order for the step s999 to be
executed.

In the contract, the author who developed step ERROR_HANLDING must be
thinking that it is the OR condition that implied to the requirement. He
wants the ERROR_HANDLING step to be executed if any one of the three steps
in the requirement failed.

My questions are:

1. Which step has the correct requirement?
2. If the AND is implied, how do I implement the OR?
3. Vise versa, if the OR is implied, how do I implement the AND?

Thanks in advance...

Best regards

David.



Reply With Quote
  #2  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: AND or OR condition? - 05-05-2004 , 02:42 AM






Have a look at this article

Introduction to Workflow
(http://www.sqldts.com/default.aspx?287)

Followed by

Multiple Paths in Workflow
(http://www.sqldts.com/default.aspx?218)

--

----------------------------

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org


" David N." <huongdat (AT) comcast (DOT) net> wrote

Quote:
Hi All,

I see the following DTS definitions, and they confused me:

1. Step that is executed based on the success of previous STEPS

STEP Id="s999"

REQUIREMENT TYPE="SUCCESS" STEP="s4A"/

REQUIREMENT TYPE="SUCCESS" STEP="s4B"/

REQUIREMENT TYPE="SUCCESS" STEP="s4C"/

REQUIREMENT TYPE="SUCCESS" STEP="s4C_A"/

REQUIREMENT TYPE="SUCCESS" STEP="s4C_B"/

SQLCMD Id="EndPackage" CONNECTION="DESTINATION" AsRowset="false"

exec dbo.xxxxx

/SQLCMD

/STEP


2. Step that is executed based on the failure of previous STEPS

STEP Id="ERROR_HANLIND"

REQUIREMENT TYPE="FAILURE" STEP="020 "/

REQUIREMENT TYPE="FAILURE" STEP="s1"/

REQUIREMENT TYPE="FAILURE" STEP="010"/

SQLCMD Id="Error_Handling" CONNECTION="CONFIG" AsRowset="false"

EXEC dbo.xxxxx

/SQLCMD

/STEP



In my thinking, the author who developed step s999 in #1 must be thinking
that it is the AND condition that implied to the requirement. He wants
all
of those previous steps to be success in order for the step s999 to be
executed.

In the contract, the author who developed step ERROR_HANLDING must be
thinking that it is the OR condition that implied to the requirement. He
wants the ERROR_HANDLING step to be executed if any one of the three steps
in the requirement failed.

My questions are:

1. Which step has the correct requirement?
2. If the AND is implied, how do I implement the OR?
3. Vise versa, if the OR is implied, how do I implement the AND?

Thanks in advance...

Best regards

David.





Reply With Quote
  #3  
Old   
David N.
 
Posts: n/a

Default Re: AND or OR condition? - 05-05-2004 , 12:18 PM



Thanks Allan,


The two articles answer my first question: the DTS package uses the logical
AND, which means that all requirements must be fullfilled in order for the
step to be executed. This means that the code in #1 is correct.

However, they did not answer the my second question, which is, how do I
apply the logical OR? There is a package property "fail package on first
error", but I am not so sure if checking that property checkbox would
guarantee that the Error_Handling step is to be executed on the first error
or not.

DQ

"Allan Mitchell" <allan (AT) no-spam (DOT) sqldts.com> wrote

Quote:
Have a look at this article

Introduction to Workflow
(http://www.sqldts.com/default.aspx?287)

Followed by

Multiple Paths in Workflow
(http://www.sqldts.com/default.aspx?218)

--

----------------------------

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org


" David N." <huongdat (AT) comcast (DOT) net> wrote in message
news:%234Y$lGkMEHA.340 (AT) TK2MSFTNGP11 (DOT) phx.gbl...

Hi All,

I see the following DTS definitions, and they confused me:

1. Step that is executed based on the success of previous STEPS

STEP Id="s999"

REQUIREMENT TYPE="SUCCESS" STEP="s4A"/

REQUIREMENT TYPE="SUCCESS" STEP="s4B"/

REQUIREMENT TYPE="SUCCESS" STEP="s4C"/

REQUIREMENT TYPE="SUCCESS" STEP="s4C_A"/

REQUIREMENT TYPE="SUCCESS" STEP="s4C_B"/

SQLCMD Id="EndPackage" CONNECTION="DESTINATION" AsRowset="false"

exec dbo.xxxxx

/SQLCMD

/STEP


2. Step that is executed based on the failure of previous STEPS

STEP Id="ERROR_HANLIND"

REQUIREMENT TYPE="FAILURE" STEP="020 "/

REQUIREMENT TYPE="FAILURE" STEP="s1"/

REQUIREMENT TYPE="FAILURE" STEP="010"/

SQLCMD Id="Error_Handling" CONNECTION="CONFIG" AsRowset="false"

EXEC dbo.xxxxx

/SQLCMD

/STEP



In my thinking, the author who developed step s999 in #1 must be
thinking
that it is the AND condition that implied to the requirement. He wants
all
of those previous steps to be success in order for the step s999 to be
executed.

In the contract, the author who developed step ERROR_HANLDING must be
thinking that it is the OR condition that implied to the requirement.
He
wants the ERROR_HANDLING step to be executed if any one of the three
steps
in the requirement failed.

My questions are:

1. Which step has the correct requirement?
2. If the AND is implied, how do I implement the OR?
3. Vise versa, if the OR is implied, how do I implement the AND?

Thanks in advance...

Best regards

David.







Reply With Quote
  #4  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: AND or OR condition? - 05-05-2004 , 02:50 PM



Fail package on first error does just that, it fails the package on the
first error within. That is not a task.

To implement a logical OR page 2 should have helped

Multiple Paths in Workflow
(http://www.sqldts.com/default.aspx?218,2)

--
--

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org


" David N." <huongdat (AT) comcast (DOT) net> wrote

Quote:
Thanks Allan,


The two articles answer my first question: the DTS package uses the
logical
AND, which means that all requirements must be fullfilled in order for the
step to be executed. This means that the code in #1 is correct.

However, they did not answer the my second question, which is, how do I
apply the logical OR? There is a package property "fail package on first
error", but I am not so sure if checking that property checkbox would
guarantee that the Error_Handling step is to be executed on the first
error
or not.

DQ

"Allan Mitchell" <allan (AT) no-spam (DOT) sqldts.com> wrote in message
news:uTTMTSnMEHA.684 (AT) TK2MSFTNGP09 (DOT) phx.gbl...
Have a look at this article

Introduction to Workflow
(http://www.sqldts.com/default.aspx?287)

Followed by

Multiple Paths in Workflow
(http://www.sqldts.com/default.aspx?218)

--

----------------------------

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org


" David N." <huongdat (AT) comcast (DOT) net> wrote in message
news:%234Y$lGkMEHA.340 (AT) TK2MSFTNGP11 (DOT) phx.gbl...

Hi All,

I see the following DTS definitions, and they confused me:

1. Step that is executed based on the success of previous STEPS

STEP Id="s999"

REQUIREMENT TYPE="SUCCESS" STEP="s4A"/

REQUIREMENT TYPE="SUCCESS" STEP="s4B"/

REQUIREMENT TYPE="SUCCESS" STEP="s4C"/

REQUIREMENT TYPE="SUCCESS" STEP="s4C_A"/

REQUIREMENT TYPE="SUCCESS" STEP="s4C_B"/

SQLCMD Id="EndPackage" CONNECTION="DESTINATION" AsRowset="false"

exec dbo.xxxxx

/SQLCMD

/STEP


2. Step that is executed based on the failure of previous STEPS

STEP Id="ERROR_HANLIND"

REQUIREMENT TYPE="FAILURE" STEP="020 "/

REQUIREMENT TYPE="FAILURE" STEP="s1"/

REQUIREMENT TYPE="FAILURE" STEP="010"/

SQLCMD Id="Error_Handling" CONNECTION="CONFIG" AsRowset="false"

EXEC dbo.xxxxx

/SQLCMD

/STEP



In my thinking, the author who developed step s999 in #1 must be
thinking
that it is the AND condition that implied to the requirement. He
wants
all
of those previous steps to be success in order for the step s999 to be
executed.

In the contract, the author who developed step ERROR_HANLDING must be
thinking that it is the OR condition that implied to the requirement.
He
wants the ERROR_HANDLING step to be executed if any one of the three
steps
in the requirement failed.

My questions are:

1. Which step has the correct requirement?
2. If the AND is implied, how do I implement the OR?
3. Vise versa, if the OR is implied, how do I implement the AND?

Thanks in advance...

Best regards

David.









Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.