Mapping bigint variables

Someone asked this earlier, but the answer did'nt seem to be right (anymore). I am having some trouble in mapping a bigint result from an ADO.NET resultset to a variable in SSIS. Whatever variable data type I tried, except for the Object type, I get the following error message:

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

I get this error message even when the variable data type is Int64, which in my opinion should be the right data type for a bigint result. The only data type that seems to work is Object; but I want to understand why. The problem definitely has to do with the bigint datatype. If I cast my value to int (possibly losing information, so I did this only for the purpose of testing) and change the variable data type to Int32, everything works properly.

Someone else earlier answered (somewhere in June) that bigint results are returned as String, but that does not seem to be the case (anymore).

Any explanations are greatly appreciated!


Regards,
Hans Geurtsen.


Answer this question

Mapping bigint variables

  • Ian-XPL

    Ok So it would seem a bigint gets thought of as a string. To test do this Create a variable of type object Add an ExecuteSQL task Select CAST(1 as BIGINT) as VALUE is the SQL Statement Map VALUE to the variable Add a breakpoint to the PostExecute event of the ExecuteSQL task When it breaks add the variable to the watch window. Look to the right and you will see the value type that was returned. Allan "Hans Geurtsen@discussions.microsoft.com" wrote in message news:a95bc423-2a8f-4d27-ab6a-1fcefbad8877@discussions.microsoft.com: > Someone asked this earlier, but the answer did'nt seem to be right > (anymore). I am having some trouble in mapping a bigint result from an > ADO.NET resultset to a variable in SSIS. Whatever variable data type I > tried, except for the Object type, I get the following error message: > > Error: The type of the value being assigned to variable "User:: name>" differs from the current variable type. Variables may not change > type during execution. Variable types are strict, except for variables > of type Object. > > I get this error message even when the variable data type is Int64, > which in my opinion should be the right data type for a bigint result. > The only data type that seems to work is Object; but I want to > understand why. The problem definitely has to do with the bigint > datatype. If I cast my value to int (possibly losing information, so I > did this only for the purpose of testing) and change the variable data > type to Int32, everything works properly. > > Someone else earlier answered (somewhere in June) that bigint results > are returned as String, but that does not seem to be the case (anymore). > Any explanations are greatly appreciated! > > > Regards, > Hans Geurtsen.
  • Mapping bigint variables