Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2003
    Location
    Colorado
    Posts
    2

    Unanswered: DTS - Write Exceptions to table?

    Can DTS write exceptions to a database table? In the code
    below, I copy fname, lname and (at the end) company from
    the source to the destination. However, with title, if the
    title is executive or president, the title is copied over;
    if the title is ceo it is entered into the destination
    table as ceo/chairman; if none of these conditions apply
    (i.e. title is owner) I want the entire row written to a
    new table.

    If I use Main = DTSTransformStat_SkipRow, rows that meet
    the title criteria are entered into the destination table,
    and the rows that don't meet the criteria are not entered.
    I can get DTS to output the exeption file to a text file,
    however, with the large number of records that don't meet
    the criteria, it would be better to have them in a new
    table.

    Thanks,

    Jay



    --------------------------------

    Function Main()
    DTSDestination("fname") = DTSSource("fname")
    DTSDestination("lname") = DTSSource("lname")

    'Check Titles
    If lcase(DTSSource("title")) = "executive" then
    DTSDestination("title") = DTSSource("title")
    ElseIf lcase(DTSSource("title")) = "president" then
    DTSDestination("title") = DTSSource("title")
    ElseIf lcase(DTSSource("title")) = "ceo" then
    DTSDestination("title") = "CEO/Chairman"
    Else
    Main = DTSTransformStat_ExceptionRow
    'Main = DTSTransformStat_SkipRow
    Exit Function
    End if



    DTSDestination("company") = DTSSource("company")
    Main = DTSTransformStat_OK
    End Function

  2. #2
    Join Date
    Feb 2003
    Location
    Milano, Italy
    Posts
    80
    You can break your task in 2 phases:

    First Transformation Task:
    Insert / Update all rows that meet the criteria

    Second Transformation Task:
    Insert rows that does not meet the criteria in a anther table

    Remeber the you can have more than one transformatrion task between two connections
    Davide Mauri
    http://www.davidemauri.it

  3. #3
    Join Date
    Jul 2003
    Location
    Colorado
    Posts
    2

    thanks

    Thanks - I will give that a try.

Posting Permissions

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