Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DTS task available?

Status
Not open for further replies.

JRtoad

Technical User
Dec 19, 2003
15
US
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?

thanks
 
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.

HTH,
John
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top