Dts object not available in Script Component

  • I dragged a script component onto my Data Flow designer, then went to the Script page, and clicked Design Script button to start writing what I thought was going to be an incredibly easy script.

    I started typing "Dts." but didn't get any intellisense whatsoever. And if I try to complete a line like:

    Dts.Variables("myVariableName").Value = "some value goes here"

    the Dts part is underlined with a squiggly blue line and if I hover over it says

    Name 'Dts" is not declared

    How can that be? How do I get this resolved? Any ideas would be greatly appreciated!

  • Are you typing your script within the following section?

    Public Sub Main()

    ...

    End Sub

  • Sorry, I mis-read your original question.

    You are within the data flow pipeline, so the logic you use applies to each record you are reading.

    Here are a couple of things you will need to do:

    1. Add the package variable to the ReadOnlyVariables or ReadWriteVariables section of the script task.

    2. Within the following sectiion of the script "Public Overrides Sub Input0_ProcessInputRow(ByVal Row As Input0Buffer)", reference the variable using variables. . You cannot use the dts. prefix here.

  • Thank you for the replies. I finally realized what was going on too. That is, you can't use the Dts object inside the Data Flow task. Not particulary obvious, IMHO, but at least there was an answer for it! (I was getting worried that since I had recently installed VS2008 for my .NET development work that that somehow trounced the object references in VS2005 or...).

  • Can you please explain in detail how you resolved this issue?

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

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