This is the goofiest thing I've seen all day.
In SSIS 2005, I have an Execute SQL Task which runs a SQL 2005 stored proc that takes two IN parameters and one OUTPUT parameter. The IN parameters are static and so are hard-coded in the command string. The OUTPUT parameter is pulled into a package variable of type Int32 (although in the Execute SQL Task on the Parameter Mapping page it tells me the data type is LONG).
When I run the SQL Task and the output parameter is returning a value > 0 (like 2), the variable is populated with 2. When I run the SQL task and the output parameter is returning -1, the package variable is populated with some value like 66682316. I can run the proc in SSMS and if the value is pre-populated with -1, it returns -1 to me.
DECLARE @out int
SET @out = -1
EXECUTE MyProc 'param1', 'param2', @out OUTPUT
SELECT @out -- returns -1
Does anyone have any idea why it would be returning this value instead of -1? I'm sure my variable is Int32 and not UInt32.