Data Driven Task

  • I am trying to develop a Data Driven Query Task. I have the following data

    Row_ID int

    Publisher varchar

    BookTitle varchar

    DateOfPurchase varchar

    and here is my ActiveX script.

    Function Main()

    DTSDestination("Row_ID") = DTSSource("Row_ID")

    DTSDestination("Publisher") = DTSSource("Publisher")

    DTSDestination("BookTitle") = DTSSource("BookTitle")

    DTSDestination("DateOfPurchase") = DTSSource("DateOfPurchase")

    If DTSSource("UpdateCode") = 1 then

    Main = DTSTransformstat_UpdateQuery

    else

    Main = DTSTransformstat_InsertQuery

    End if

    End Function

    When I run the script the first time, it works and adds the data from the Source to the Destination. But when I run the script a second time, I get the following error:

    Syntax error converting varchar value 'Feb 1 2002 12:00 AM to a column of type int

    What is the problem?

  • This was removed by the editor as SPAM

  • I would guess the cause is one of the cols from source is not matching the dest. one. I have had this when the data in the row from source is missing a col and attempted to enter data in the wrong field data type.

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

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