How to skip some rows whiel importing

  • I am importing  excel sheet data to Sqlserver using DTS.

    Is there any way we can skip few rows while import!

     


    Kindest Regards,

    Pavas

    Dream The Dream
    Explore the World
    Experince The Exhilaration

  • I assume that these rows are in the middle.



    Good Hunting!

    AJ Ahrens


    webmaster@kritter.net

  • Where's the rest of the post AJ?

  • I had to do this to a file that had three record types. In the first field (DTSSource("Col001")) there were values showing the type of the row. (1, 2, 9)

    I created three DTS packages (one for each type) and then performed the following:

     if DTSSource("Col001") = "1" then

      DTSDestination("SYCO") = DTSSource("Col015")

      DTSDestination("SYKCOO") = DTSSource("Col016")

      DTSDestination("SYDOCO") = DTSSource("Col017")

      DTSDestination("SYDCTO") = DTSSource("Col018")

      DTSDestination("SYSFXO") = DTSSource("Col019")

      DTSDestination("SYAN8") = DTSSource("Col023")

      DTSDestination("SYVINV") = DTSSource("Col024")

      Main = DTSTransformStat_OK

     else

      Main = DTSTransformStat_SkipRow

     end if

    That should help.

  • If you have the condition to skip rows then this should work:

    If <<condition>> Then

            Main = DTSTransformStat_SkipInsert

    Else

           DTSDestination("....") = DTSSource("......")

           ....................

            Main = DTSTransformStat_OK

    End If

     

    Hope this helps

     

     

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

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