active-x script parse error!

  • I have a active-x script task in SSIS to set a string variable. When I am trying to check syntax it fails. It says that expected end of statement.

    Please check snap for more details. Please don't suggest to use the script task. I want to know why I am not able to use the old script in SQL 2005.

    Thanks,

    Nikhil

  • Hi

    When looking at the picture it seems that you are missing the & before concatinating the starttime dts variable.

    /Michael

  • From your screen shot it is difficult to distinguish between long lines (which have wrapped) and true line breaks. Can you widen it to make this clearer? Or just cut & paste into your answer.

    If you haven't even tried to resolve your issue, please don't expect the hard-working volunteers here to waste their time providing links to answers which you could easily have found yourself.

  • It's been a while since I've used an ActiveX script task in DTS, but I remember not being able to specify the types of your variables.

    Change your 2nd line of code from Dim sSalesQuery as string to Dim sSalesQuery to resolve your parse error.

    There are still a few issues with your code. As mentioned above, you're missing the "&" before the concatenation of your startdate variable. However, the syntax you're using to retrieve the variable values is wrong. The correct syntax for your last line should be sSalesQuery = sSalesQuery & " and orderheader.datemodified between '" & DtsGlobalVariables("startdate").Value & "' and '" & DtsGlobalVariables("enddate").Value & "')"

    It looks to me like the line orderheader.OrderStatus <> 5 and orderheader.OrderType <> 8 should be and orderheader.OrderStatus <> 5 and orderheader.OrderType <> 8.

    You really should consider converting to a Script task, mainly because the ActiveX Script task has been deprecated and could be removed from a future version of SSIS.

  • Thanks Erik,

    I wud try to use the script task if active-x script task is going away...

    Thanks everyone for replies..

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

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