Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2003
    Longmont, CO

    Angry Unanswered: DTS Script trying to re-execute another task in package

    I'm new to the whole DTS scene and not impressed with the info I'm finding. Here's what I'm trying to do:

    I have two recordsets generated by ExecteSQLTasks (created as output global variables). While I'm looping through one recordset in a script I would like to do data-driven updates of the second recordset based on data in the first. This seemed easy at first. I thought I could just do a little hoochie coochie:

    Dim objPackage
    Dim objTask
    Dim objCustomTask

    Set objPackage = DTSGlobalVariables.Parent

    For each objTask in objPackage.Tasks
    If objTask.CustomTask.Description = "The description I gave it!" Then
    objTask.Properties("SQLStatement").Value = "My new SQL statement"
    End If

    And voila! I'd have my new recordset established as a new value for the global variable. But no! It doesn't seem to work that way. What's up with this?

    FYI, I also tried to apply filters to the original recordset using:

    rs.Filter = " table.field = " & varMyDataNotAString

    But that didn't work either. Grrrr!

    Anybody out there doing things like this and getting them to work?


  2. #2
    Join Date
    Aug 2002
    Check SQLDTS website and search for GLOBAL VARIABLES which will show code examples to use so.

    --Satya SKJ
    Microsoft SQL Server MVP

  3. #3
    Join Date
    Jun 2003
    Longmont, CO


    Actually, I'm pretty sure this is where I originally got the code in my initial post. The issue is that using this code did not refresh my global variable (and hence my recordset). I could change the SQL statement, but either the Task doesn't actually execute with the


    or somehow the global variable isn't refreshed.

    I plan to continue playing with it today.

    Thanks for your reply!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts