Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Variable data type in ForEach Loop

Status
Not open for further replies.

JulsY

Programmer
Jan 22, 2002
24
0
0
US
Hi,
I have a SQl task that runs a query that is assigned to an Object type variable. There are 4 columns being returned by this query. First 3 are string and last is a tinyint. Then in a Foreach loop I use Foreach ADO Enumerator to extract the rusults out from this Object variable. In the Variable Mapping page I list variables to put each of the 4 column values into. The 4th column (tinyint datatype) I am assigning to a variable that I defined with DataType Int16. Also, in my Loop I have SQL task in which I created a Parameter using this Int16 variable as a source and gave it a "numeric" datatype (this is the closest type avialable in drop down).
When I run I get an error:

Error: The type of the value being assigned to variable "User::varGetLastModDate" differs from the current variable type. Variables may not change type during execution. Variable types are strict, except for variables of type Object.

Please help.. what should I set my variable type to?
 
try assigning it as an Int32 and then in your SQL task set it as a LONG.

Paul
---------------------------------------
Shoot Me! Shoot Me NOW!!!
- Daffy Duck
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top