Welcome to MSDN Blogs Sign in | Join | Help

Why can’t I store my BIGINT result in an Int64 variable?

The native providers (OLEDB, ODBC, ADO – ADO.NET doesn't have this problem) in the Execute SQL Task return the BIGINT type as a String, and not an Int64 as you'd expect. Attempting to store the result in an Int64 variable gives you an error along the lines of:

[Execute SQL Task] Error: An error occurred while assigning a value to variable "xxxx": "The type of the value being assigned to variable "xxxx" differs from the current variable type. Variables may not change type during execution. Variable types are strict, except for variables of type Object."

Although this behavior is documented in the books online entry, we don't explain why it was done this way. Being somewhat new to the SSIS development team, I had to do some digging to find out for myself. It turns out that at the time this was implemented, there wasn't cross platform support for the 8-byte integer type (VT_I8/VT_UI8) in VARIANTs -- specifically, on Windows 2000. Now that supporting Win2k is no longer an issue (for Katmai), we're free to change the behavior (while maintaining backwards compatibility for packages that are expecting the value as a string, of course).

Expect this as a likely change in an upcoming release.

Published Wednesday, April 18, 2007 9:02 PM by mmasson
Filed under:

Comments

# re: Why can’t I store my BIGINT result in an Int64 variable?

Hi,

This is a problem that was already posted on Andrea Benedetti (Italian SQL Server MVP) blog and in mine one..

here the addresses:

Andrea: http://blogs.ugidotnet.org/ab/archive/2006/08/09/46012.aspx

SuxStellino (my nick, i'm Alessandro ;-) ):

http://blogs.dotnethell.it/suxstellino/Problema-di-gestione-dei-bigint-Int64__3959.aspx

http://blogs.dotnethell.it/suxstellino/Problema-BigInt-e-Int64-remake__6056.aspx

Both blogs are in italian.. but subject is the same..

We use strings to store bigint format.. bu we know that is a workaround..

So, thanks to you.. this post give us an explanation stored in books online ;-)..

but we are with you.. why MS and SSIS follow this way?

We found problem some times ago.. nearly one year :S

Like our blogs says.. we'll wait for next releases..

Hope soon..

bye,

Sux.

Friday, April 27, 2007 2:17 PM by Sux.Stellino
Anonymous comments are disabled
 
Page view tracker