SSIS 2008 Performing a mapping of SQL output parameters datetime2

I am trying to use the Execute SQL Task in SSIS 2008 to map the output parameter of a warehouse procedure to a package variable.

The batch variable is the DateTime type of the SSIS type, and the storage procedure parameter is the DATETIME type of the SQL type.

The SQL statement EXEC GetCurrentDate @CurrentDate=?and on the parameter mapping screen the parameter is mapped to a package variable with the specified direction of Output and Data Type DBTIMESTAMP.

When I run the package, I get the following error:

[Executing SQL task] Error: executing query "EXEC GetCurrentDate @CurrentDate =?" failed with the following error: "The type value is assigned to the variable" User :: CurrentDate "is different from the type of the current variable. Variables may not change type at run time. Variable types are strict, except variables of type Object.". Possible causes of the failure: problems with the query, the ResultSet property is not set correctly, the parameters are not set correctly, or the connection is not installed correctly.

If I run a trace on an executed query, I see that the type is assumed as datetime2:

declare @p3 datetime2(7)
set @p3=NULL
exec sp_executesql N'EXEC GetCurrentDate @CurrentDate=@P1 ',N'@P1 datetime2(7) OUTPUT',@p3 output
select @p3

Does anyone know why the datetime2 type is supposed to be?

thanks

+3
2

Micorsoft Connect:

, sql datetime. oledb sql, COM VARIANT , - BSTR. User:: dateParam String, , COM-.

http://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=307835

+3

inout/output DATE, DBTIMESTAMP SSIS.

, , SSIS 2005, .

, , SSIS .

0

Source: https://habr.com/ru/post/1708545/


All Articles