DTS ActiveX in-line SQL Query Help

  • I have a DTS package that currently imports data from a Text file - nothing too exciting there. But a change in the file format (by the client) now requires a quick look-up to the database to evaluate if the row should even be imported from the text file or not.

    The import is controlled completely by an ActiveX script already. Currently, I evaluate whether or not the row is from the current year, and if it is, I import the row. I need to change it to now look at a table in the database (a connection which already exists), and if the date in the file falls between 2 dates in a specific table, import it, otherwise discard it.

    The current code's "IF" statement:

    IF year(DTSSource("Col007")) = DTSGlobalVariables("gv_FileYear").Value THEN

    What I need it to do (pseudo-code):

    IF "SELECT Year_Number FROM dbo.RollPeriod WHERE year(DTSSource("Col007")) BETWEEN FirstDay AND LastDay" = DTSGlobalVariables("gv_FileYear").Value THEN

    I'm a DBA, not a developer. I know my way around VB code about as well as politicians know how to be honest. ANY help is GREATLY appreciated.

    Thanks!

  • See "Using Multiple Lookup Queries" in SQL BOL for help on using Lookups.

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

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