Moving to a new task in DTS?

  • Hello,

    I haven't used DTS in quite awhile and I have an easy question ... how do I tell the package to move to and start executing from a different task instead of the next one in line upon success, based on a condition?

    Note the bolded area:

    '**********************************************************************

    ' Visual Basic ActiveX Script

    '************************************************************************

    'Checks for esistence of trigger file and that it was created on the same

    Function Main()

    Dim fso

    Dim file

    Set fso = CreateObject("Scripting.FileSystemObject")

    Set file = fso.GetFile(DTSGlobalVariables("Note").Value)

    If file.size > 0 Then

    Main = DTSTaskExecResult_Success

    Else

    Main = DTSStep_DTSActiveScriptTask_3

    'How do I tell it to go this step if the file size isn't greater than 0?

    End If

    Set file = Nothing

    Set fso = Nothing

    End Function

  • Use work flow task.

    right click on data transform item, select work flow properties, select the item to execute next.:D

  • Debra Owens (2/6/2008)


    Use work flow task.

    right click on data transform item, select work flow properties, select the item to execute next.:D

    Well, I only want to go that path if the file is empty ... meaning, I need a work flow. I saw the article on SQLDTS.com about creating a DTS workflow, but that seems way over complicated for such the simple task that I'm trying to achieve ...

    If file is empty -> goto step 8

    If file is not empty -> goto step 2

  • This is what I did.

    I created a DTS job per item.

    I scheduled the jobs (this create a SQL Server Agent for each DTS job).

    Create a new Server Agent.

    Open each scheduled DTS task, copy the DTSRun /~Z etc..

    and drop in the newly created Server agent as a task.

    Once you have all of the task added, edit the task goto Advance and indicate if job fails goto task.. and if job sucessful goto task..

    Delete the Server task that the DTS created, all you need from the task is the DTSRun.

    Hope that helps.

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply