September 24, 2009 at 10:18 am
SSIS Script Component Variable Assignment Error
Any help on the issue below would be much appreciated.
I am, what I think, try to do a pretty simple task but having much difficulty. Within the Script Component task I am try to do the following:
1. Read in a variable from the SSIS package
2. Assign this variable to a variable within the script component
3. Increment the script component variable and assign the result to each line
Here is the code:
Public Class ScriptMain
Inherits UserComponent
Dim dblRow As Double = Me.Variables("SSIS Variable")
Public Overrides Sub Input0_ProcessInputRow(ByVal Row As Input0Buffer)
Row.Key = dblRow
dblRow += 1
End Sub
End Class
The line:
Dim dblRow As Double = Me.Variables("SSIS Variable")
Returns the following error:
Class 'ScriptComponent_(Lots of Letters/Numbers).Variables' cannot be indexed because it has no default property.
Help!!!
Thanks
September 24, 2009 at 12:20 pm
September 24, 2009 at 1:01 pm
Same Result
September 24, 2009 at 1:06 pm
September 24, 2009 at 1:11 pm
Public Class ScriptMain
Inherits UserComponent
Dim dblRow As Double
Public Overrides Sub PreExecute()
dblRow = Me.Variables.NameOfYourVariable
MyBase.PreExecute()
End Sub
Public Overrides Sub Input0_ProcessInputRow(ByVal Row As Input0Buffer)
Row.Key = dblRow
dblRow += 1
End Sub
End Class
September 24, 2009 at 1:25 pm
Some information on using variables in a Script Component:
http://msdn.microsoft.com/en-us/library/aa337079%28SQL.90%29.aspx
http://msdn.microsoft.com/en-us/library/ms136033.aspx - scroll down to the section titled "Interacting with the Package in the Script Component."
September 24, 2009 at 1:26 pm
September 24, 2009 at 3:22 pm
Bingo...Erik Thanks! Also, thanks for the link to the article
CozyRoc thanks for your help as well
Viewing 8 posts - 1 through 8 (of 8 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy