Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SSIS and Import/Export (2005)
 Can't update package variable

Author  Topic 

pshaw
Starting Member

5 Posts

Posted - 2007-10-23 : 14:46:48
I am trying to update a package variable using a script component. I have done this before and it worked fine, but for some reason the script runs but the variable isn't updated. The variable is called CTDI_SQL, string, readonly=false, scope=package. My script is in a data flow task, has CTDI_SQL in the readwrite variables section and this is the code:
Dim strSQL As String
Dim v As IDTSVariables90

strSQL = "SELECT * FROM T1"

Me.VariableDispenser.LockOneForWrite("CTDI_SQL", v)
v("CTDI_SQL").Value = strSQL

v.Unlock()

What am I missing? Thanks
   

- Advertisement -