I would like to be able to branch from a 'task' based on a result from the database. Is there such a task where i can query the DB and return a result such as 1 or 0 and be able to branch one way or the other based on the result?
Currently, to the best of my knowledge, this would only be possible by using the ActiveX task and some coding.
One possible way to accomplish this would be to (using the ActiveX task) connect to the database, submit your query, interrogate the result, then make use of the OnSuccess and OnFailure workflow constraints to perform your branching. This would be done by using something like (pseudocode following
Code:
...
If (DBMSResult == 1) Then
Main = DTSTaskExecResult_Success
Else
Main = DTSTaskExecResult_Failure
End If
The obvious limitation to this method is it would only allow for two-way branching.
There are more sophisticated ways to accomplish branching with fewer limitations, but this "simple" method will often work if the neccessary logic is not too complicated, and it is much easier to implement.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.