SQL Server Performance

Problem with ActiveX Script IF...END IF

Discussion in 'SQL Server DTS-Related Questions' started by Cyberwombat, Jul 13, 2005.

  1. Cyberwombat New Member

    I have a relatively simple transformation task that needs to compare an incoming value to a global variable value, but can't seem to get the syntax right. Here it is:

    Function Main()

    if DTSSource("Date Applied") >= DTSGlobalVariables("DateClosed").value then
    DTSDestination("field_name) = DTSSource("field_name")
    Main = DTSTransformStat_OK
    else
    Main = DTSTransformStat_SkipInsert
    end if

    End Function


    When I try to test the task I get the following error:

    "Invalid procedure call or arguement: 'DTSSource'"


    What am I doing wrong here? I need a similar test in several tasks.

    TIA - Cyberwombat

    <font color="red"><h6>The Romans did not create a great empire by having meetings...they did it by killing all who opposed them.</h6></font id="red">
  2. satya Moderator

    What is the datatype used for 'Date Applied' and I guess because of space in that variable you are getting issue.

    Satya SKJ
    Moderator
    http://www.SQL-Server-Performance.Com/forum
    This posting is provided “AS IS” with no rights for the sake of knowledge sharing.
  3. Cyberwombat New Member

    Originally posted by satya

    What is the datatype used for 'Date Applied' and I guess because of space in that variable you are getting issue.

    'Date Applied' is a smalldatetime field name from the incoming table.

    The Romans did not create a great empire by having meetings...they did it by killing all who opposed them.
  4. satya Moderator

    Have you tried without using 'whitespace' in that variable?

    Satya SKJ
    Moderator
    http://www.SQL-Server-Performance.Com/forum
    This posting is provided “AS IS” with no rights for the sake of knowledge sharing.

Share This Page