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)
 Problem with Variable

Author  Topic 

koolkeith19
Starting Member

14 Posts

Posted - 2008-12-04 : 11:04:30

Here is my code in a SQL Script, my Variable ET_TruckDateTime_SEL_RouteId is defined as auser type and is a string. I get the error below in bold.

    Dim vars As Variables
Dts.VariableDispenser.LockOneForWrite("ET_TruckDateTime_SEL_RouteId", vars)
Dts.VariableDispenser.GetVariables(vars)
vars("ET_TruckDateTime_SEL_RouteId").Value = "testing"
Dts.TaskResult = Dts.Results.Success


The element cannot be found in a collection. This error happens when you try to retrieve an element from a collection on a container during execution of the package and the element is not there.

any ideas??

thanks!

koolkeith19
Starting Member

14 Posts

Posted - 2008-12-04 : 15:16:47
i have since tried this but no luck, same error:

Dts.VariableDispenser.LockOneForWrite("User::ET_TruckDateTime_SEL_RouteId", vars)
Dts.VariableDispenser.GetVariables(vars)
vars(0).Value = "testing"

Dts.TaskResult = Dts.Results.Success

The element cannot be found in a collection. This error happens when you try to retrieve an element from a collection on a container during execution of the package and the element is not there.
Go to Top of Page

rgombina
Constraint Violating Yak Guru

319 Posts

Posted - 2008-12-05 : 06:12:14
Set DelayValidation to TRUE
Go to Top of Page
   

- Advertisement -